How to create an empty array in JavaScript

2 Answers

0 votes
let arr = new Array();


console.log(arr);



/*
run:
	
[]	

*/

 



answered Jun 16, 2020 by avibootz
0 votes
let arr = [] 


console.log(arr);



/*
run:
	
[]	

*/

 



answered Jun 16, 2020 by avibootz

Related questions

2 answers 271 views
1 answer 118 views
3 answers 251 views
2 answers 184 views
1 answer 158 views
...