Profile
Achievement
hellowouter's Recent SnippetsTagged array
- All /
« Prev 1 Next »
In this purely constructed example, we create anonymous function and use call to invoke it on every object in an array. The main purpose of the anonymous function here is to add a print function to every object, which is able to print the right index...
0
931
posted 12 years ago by hellowouter
Clever usage of apply allows you to use built-ins functions for some tasks that otherwise probably would have been written by looping over the array values. As an example here we are going to use Math.max/Math.min to find out the maximum/minimum valu...
0
1322
posted 12 years ago by hellowouter