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 274 views
1 answer 121 views
3 answers 263 views
2 answers 190 views
1 answer 167 views
...