1var arr = [];
2arr[0] = "Jani";
3arr[1] = "Hege";
4arr[2] = "Stale";
5arr[3] = "Kai Jim";
6arr[4] = "Borge";
7
8console.log(arr.join()); // Jani,Hege,Stale,Kai Jim,Borge
9arr.splice(2, 0, "Lene");
10console.log(arr.join()); // Jani,Hege,Lene,Stale,Kai Jim,Borge
1// Be careful!
2
3const arr = [ 1, 2, 3, 4 ];
4arr[5] = 'Hello, world!';
5
6console.log(arr); // [ 1, 2, 3, 4, <1 empty item>, 'Hello, world!' ]
7console.log(arr.length); // 6