Can I do a foreach on a function that takes an array object and sorts it. I know I can do a dependent observable, but I have an array of an array coming from the mapping plugin.
foreach: sortList($array)
Can I do a foreach on a function that takes an array object and sorts it. I know I can do a dependent observable, but I have an array of an array coming from the mapping plugin.
foreach: sortList($array)
Yes... Here's a fiddle to demonstrate:
http://jsfiddle.net/jearles/sHQvV/
It shows three usages of foreach:
1) Plain 2) Function returning array 3) Object with data property containing an array
The foreach documentation describes this.