I often define an array like this:
var arr = new Array();
But when my PM saw my code, my PM said that I should define an array like this:
var arr = [];
and it will be more efficient. I find that there is another defined way var arr = ();?
What is the difference between them and which way do you often use?
var arr = ();?var arr = [];instead ofvar arr = new Array();because Array object can be overwritten in JavaScript, but the array literal can't