Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add element in arry in js

// initialize array
var arr = [
  "Hi",
  "Hello",
  "Bonjour"
];

// append new value to the array
arr.push("Hola");

console.log(arr);
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #element #arry #js
ADD COMMENT
Topic
Name
2+1 =