Javascript JSON parsing - object to array -


while parsing json object, there better way convert single length objects array, because when want run loop using length works arrays fail if length 1 , object (not included in []).

module:{section:{topic:"some topic"}, section:{[{topic:"some topic1"},{topic:"some topic2"},{topic:"some topic3"}]}}  

my question module.section.length second section undefined first section. there way convert objects inside json arrays?


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -