function functionsDontNeedNames(){
var a = new Array(3);//create array length 3
a[0] = function(x){return x*x};//this is now the function
a[1] = 4;//will be used as 'x'
a[2] = a[0](a[1]);//a[2] now equals 16!
}
Array Functions as Data
Leave a Reply
You must be logged in to post a comment.