Usage of the var myArray = Array(10).fill(0);
and var myArray = new Array(10).fill(0);
seemingly return the same result.
Are there any differences between these two expressions? When should you use the new
keyword and when should you not?
Usage of the var myArray = Array(10).fill(0);
and var myArray = new Array(10).fill(0);
seemingly return the same result.
Are there any differences between these two expressions? When should you use the new
keyword and when should you not?