declare aray js code example Example 1: javascript declare array var array = [] Example 2: declare an array nodejs var arr1 = new Array(); var arr2 = [];