I have some Swift code that needs to be written in javascript. I am not sure how to do this. jsonresult is the json data. Can anyone help?
let results: NSDictionary = jsonresult["results"] as! NSDictionary
let collection1: NSArray = results["collection1"] as! NSArray
for item in collection1 {
Thanks
In JS item will the index. So to access the value from the array you need to access the index of the array
collection1[item]
If
jsonResult
is an object you can simply access collection1 like this