How do I iterate over this array in array in AngularJS Javascript code:
[[4,5,6,4,8.7]]
How do I iterate over this array in array in AngularJS Javascript code:
[[4,5,6,4,8.7]]
An array is an array.
Use Array.prototype.forEach for iteration.
In this case, each item is an array, and therefore you have an inner forEach as well.
Angular also has a method for forEach. It's called angular.forEach.
You can use it if you want to or need to support ancient browsers.
[[4,5,6,4,8.7]].forEach(function(arr){ arr.forEach(function(item){ console.log(item) }) } );
P.s. to avoid the smartass that is going to say that Array.prototype.forEach wont work on IE8, then it doesn't.