How to append more that one value to an array in JavaScript

2 Answers

0 votes
let arr = [
    "javascript",
    "php",
    "css"
];
 
arr.push("html", "database");
 
console.log(arr);


  
/*
run:

[ 'javascript', 'php', 'css', 'html', 'database' ]
  
*/


 



answered Nov 17, 2017 by avibootz
edited Apr 11, 2025 by avibootz
0 votes
let arr = [
    "javascript",
    "php",
    "css"
];
 
arr.push("html", "database");

for (let i = 0; i < arr.length; i++) {
    console.log(arr[i]);
}


  
/*
run:

javascript
php
css
html
database
  
*/


 



answered Nov 17, 2017 by avibootz
edited Apr 11, 2025 by avibootz
...