I have problem understanding arrays and loops, therefore this task is a bit confusing to me. Here\'s my stuff;
JSON
{
\"states\": [
Making very minor adjustments to your code,
var a = [];
$.each(result, function(index, val){
for(var i=0; i < val.length; i++){
var item = val[i];
a.push(item);
}
});
Now do something with all of the values in the array a.
EDIT:
In case that wasn't enough,
var list = $(' ');
$.each(result.states, function(state) {
var link = $('').prop('href', state.command).text(state.name);
('').append(link).appendTo(list);
});
list is the HTML you want (except for the name capitalization...I wasn't sure if the first letter should be capitalized, or the first letter of each word, so I left that alone).