node js create array code example
Example 1: how to create an array in node js
// Don't need to provide elements directly, but you can
// FIRST OPTION
var myArray = new Array(/*elements1, elements2*/);
// SECOND OPTION
var mySecondArray = [/*element1, element2*/];
Example 2: array ub js
var fruits = ['Apple', 'Banana'];
Example 3: declare an array nodejs
var arr1 = new Array();
var arr2 = [];
Example 4: access index of array javascript
let first = fruits[0]
// Apple
let last = fruits[fruits.length - 1]
// Banana