You can push multiple elements into an array in the following way
var a = [];
a.push(1, 2, 3);
console.log(a);
More Related Contents:
- "&" and ">>" number operator in C++?
- What is JavaScript’s highest integer value that a number can go to without losing precision?
- What does it mean global namespace would be polluted?
- Is there a better way to do optional function parameters in JavaScript? [duplicate]
- Changing the browser zoom level
- Hiding the address bar of a browser (popup)
- ES6 Array destructuring weirdness
- Get functions (methods) of a class [duplicate]
- What causes the error “Can’t execute code from a freed script”
- What is NODE_ENV and how to use it in Express?
- using javascript to detect whether the url exists before display in iframe
- Access to ES6 array element index inside for-of loop
- Editing in the Chrome debugger
- Issue with Android Hybid app to display remote image with Ionic framework?
- When using jQuery on(), why use (document) vs. the element itself?
- How to set a cookie to expire in 1 hour in Javascript?
- Dynamically loading templates in Meteor.js
- How to deal with the captcha when doing Web Scraping in Puppeteer?
- Is it possible to delete a variable declared using const?
- Unusual shape of a textarea?
- Upload folder and all its content in JavaScript
- How to appendChild(element) many times. (The same element)
- Is async await truly non-blocking in the browser?
- Listen for changes with localStorage on the same window
- Retain scroll position on route change in AngularJS?
- Jquery post, response in new window
- console.log doesn’t work in CasperJS’ evaluate with setTimeout
- Updating a JSON object using Javascript
- Web Audio API, get the output from the soundcard
- How to programmatically fill input elements built with React?