[Proto-Scripty] Returning an array of results from an operation on an array.

2010-09-17 Thread Richard Quadling
Hi. How do I do something like this (just an example) ... [1,2,3].each(function(val){return val * val;}); such that the result is ... [1,4,9] It seems each() is returning the original value and not the calculation. The full code is ... $$('#cbGridContainer

Re: [Proto-Scripty] Returning an array of results from an operation on an array.

2010-09-17 Thread Jarkko Laine
On 17.9.2010, at 15.03, Richard Quadling wrote: Hi. How do I do something like this (just an example) ... [1,2,3].each(function(val){return val * val;}); such that the result is ... [1,4,9] [1,2,3].map(function(i){ return i * i }); //

Re: [Proto-Scripty] Returning an array of results from an operation on an array.

2010-09-17 Thread Richard Quadling
On 17 September 2010 13:26, Jarkko Laine jar...@jlaine.net wrote: On 17.9.2010, at 15.03, Richard Quadling wrote: Hi. How do I do something like this (just an example) ... [1,2,3].each(function(val){return val * val;}); such that the result is ... [1,4,9] [1,2,3].map(function(i){