0

Possible Duplicate:
What’s the difference between “Array()” and “[]” while declaring a JavaScript array?

var all = [];
var all = new Array();

What is the difference between these two definitions? I can't make them clear.

Community
  • 1
  • 1
Sally Lou
  • 69
  • 6

1 Answers1

0

There is no difference. But best practice is to avoid using new on JavaScript primitive types.

Ilia Frenkel
  • 1,919
  • 12
  • 18