What are the different ways to create an array in javascript?



What are the different ways to create an array in javascript?..

Answer / Amit Kumar Singh

Arrays can be created in JavaScript using the Array constructor (e.g., var arr = new Array()), array literal syntax (e.g., var arr = []), or by assigning a comma-separated list of values to a variable (e.g., var arr = [1, 2, 3]).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

How to add buttons in javascript?

1 Answers  


how to run java script program

1 Answers  


How are tag positions used in javascript?

1 Answers  


How can I request data from the server without reloading the page in the browser?

1 Answers  


How to use one javascript function for multiple input fields?

1 Answers  


Whether JavaScript has concept level scope?

1 Answers  


What is MEAN in javascript

1 Answers  


How to remove duplicates from javascript array?

1 Answers  


About document.getElementID? Explain giving one example. This was asked by a interviewer when i said that i know some JavaScript.

2 Answers   TCS,


What are the properties of stack?

1 Answers  


What does the delete operator do?

1 Answers  


Which company developed JavaScript?

1 Answers  


Categories