Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add variables to an array

// how to add variables/string/value to an array in Javascript
const addArray = [
  "Hello",
  "My",
  "Name",
  "is"
];
// add/append new value/variable/string to the array
addArray.push("Chetan");
console.log(addArray); // [ 'Hello', 'My', 'Name', 'is', 'Chetan' ]
 
PREVIOUS NEXT
Tagged: #add #variables #array
ADD COMMENT
Topic
Name
2+2 =