What is array constructor in javascript?



What is array constructor in javascript?..

Answer / Hari Keshwar Prasad

The Array constructor in JavaScript creates a new Array object. It can take an optional parameter that specifies the number of elements in the array, where each element is initially set to the specified value (usually undefined). Example: `let arr = new Array(3); // creates an array with 3 empty elements.`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

What can I build with javascript?

1 Answers  


To write messages to the screen without using "document.write()"?

1 Answers  


How do you name a variable in javascript?

1 Answers  


Explain “use strict” ?

1 Answers  


How to port a GUI application onto Web

1 Answers   TCS,


What is javascript and how it works?

1 Answers  


What is the similarity between the 1st and 2nd statement?

1 Answers  


Where do I put javascript code in html?

1 Answers  


How to display Alert in JavaScript

1 Answers   HCL,


What is the difference between null & undefined?

1 Answers  


Which is faster jquery or javascript?

1 Answers  


What are the different types of errors supported by javascript?

1 Answers  


Categories