Answers for "javascript of array"

2

use these instead of a for loop javascript

const array = [1, 2, 3];array.forEach(function(elem, index, array) {    array[index] = elem * 2;});console.log(array); // [2,4,6]
Posted by: Guest on January-25-2020
0

array of

Array.of(7);       // [7]
Array.of(1, 2, 3); // [1, 2, 3]

Array(7);          // [ , , , , , , ]
Array(1, 2, 3);    // [1, 2, 3]
Posted by: Guest on June-02-2021
0

use these instead of a for loop javascript

const array = [1,2,3,4,5];const evenNumbers = array.filter(function(elem) {   // expressions that return 'true' are retained   return elem % 2 == 0;});
Posted by: Guest on January-25-2020
0

array.of

Array.of(7); // [7]
Array(7); // array of 7 empty slots

Array.of(1, 2, 3); // [1, 2, 3]
Array(1, 2, 3);    // [1, 2, 3]
Posted by: Guest on May-11-2021
-1

array of array

String[][] arrays = new String[][] { array1, array2, array3, array4, array5 };
Posted by: Guest on April-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language