Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to double array data in js

function double (arr){
    let newArr = [];
    for(let i = 0; i < arr.length; i++){
        newArr.push(arr[i] * 2);
    }
    console.log(newArr) ;
}
console.log(double([3,4,5]));
 
PREVIOUS NEXT
Tagged: #double #array #data #js
ADD COMMENT
Topic
Name
9+5 =