Search
 
SCRIPT & CODE EXAMPLE
 

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]));
Comment

PREVIOUS NEXT
Code Example
Javascript :: reduce() break 
Javascript :: Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax. 
Javascript :: check checkbox based on value using jquery 
Javascript :: linker call rect native 
Javascript :: iiee javascript 
Javascript :: vue axios catch error 
Javascript :: how to get url in react 
Javascript :: js remove if 
Javascript :: change href without reloading page js 
Javascript :: for open new tab we are using window.open but new tab are open in left side how to change the right side 
Javascript :: imdb-api 
Javascript :: await in angular 8 
Javascript :: How to empty a folder in Node.js 
Javascript :: react native get timezone 
Javascript :: Object.hasOwnProperty.call 
Javascript :: how to update the react version in next js app 
Javascript :: jquery on click outsile hide div 
Javascript :: currying javascript sum 
Javascript :: javascript array add end 
Javascript :: convert days into year month 
Javascript :: mui get theme color in component 
Javascript :: js pass object property as a function parameter 
Javascript :: react how to update state array 
Javascript :: javascript sort numbers descending 
Javascript :: change node version 
Javascript :: javascript null true or false 
Javascript :: check to see if work is uppercase javascript 
Javascript :: sleeping in js 
Javascript :: check if input is valid js 
Javascript :: store data to the browser’s localStorage 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =