riot-js

Open full view…

How to get json object when use each loop?

sean
Mon, 26 Dec 2016 11:18:59 GMT

If I have a json file, it content is: { "name": "sean", "answer": { "a": "a", "b": "b" } }, { "name": "mary", "answer": { "a": "a", "b": "b", "c": "c" } }, { "name": "john", "answer": { "a": "a", } } How to use each loop to show all data, like this: Name: sean ( a, b, c ) Name: mary ( a, b ) Name: john ( a ) I confuse that should I use each loop twice to show "answer" object?

sean
Tue, 27 Dec 2016 00:55:42 GMT

I find this json has some bug, fixed it and finally sovle it...so, how to delete this post?