Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

square a array

function(arr) {

    ret= [];

    for (var i = 0, len = arr.length; i < len; i++) {
        ret.push(arr[i] * arr[i]);
    }

    return ret;     
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #square #array
ADD COMMENT
Topic
Name
6+5 =