javascript print array
var arr = [1,2,4,5] console.log(...arr) //Spreading operator in JS
how to display array values in javascript
// Input array contain some elements. var array = [ 'a', 'gfg', 'c', 'n' ]; // Here array.values() function is called. var iterator = array.values(); // Here all the elements of the array is being printed. for (let elements of iterator) { console.log(elements); }
Source: www.geeksforgeeks.org
display array javascript
const arr["kk","kfk","djsj"] consol.log(arr[0];