define array in node js 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: javascript declare array

var array = []

Example 3: declare an array nodejs

var arr1 = new Array();
var arr2 = [];

Example 4: array

// An array in javascript is basicly a data structure set out like this:
const MyArray = {"Object1", "Object2", "Object3"};

Tags:

Java Example