Below code demonstrates the usage of array method:
var Arr1 = [1,2,3,4,5,6,7];
console.log(Arr1.map(function(value){
return value * 2;
}));
Refer: https://docs.microsoft.com/en-us/scripting/javascript/reference/map-method-array-javascript
Practice at: http://jsbin.com
- map
var Arr1 = [1,2,3,4,5,6,7];
console.log(Arr1.map(function(value){
return value * 2;
}));
Refer: https://docs.microsoft.com/en-us/scripting/javascript/reference/map-method-array-javascript
Practice at: http://jsbin.com
No comments:
Post a Comment