开发者

Javascript Array

开发者 https://www.devze.com 2023-01-13 22:11 出处:网络
i want to use javascript array globly using netbeans ide.. i declare the array开发者_JAVA技巧 like this.layer=new Array(); and var layer=new Array(); but the problem is that when i use the array in fu

i want to use javascript array globly using netbeans ide.. i declare the array开发者_JAVA技巧 like this.layer=new Array(); and var layer=new Array(); but the problem is that when i use the array in function the drop down menu of Array functions is not shown as netbeans shows.


Type analysis for a fully-dynamic language like JavaScript is tricky and there's no guarantee an IDE will be able to resolve it. Autocompletion is very much a best-guess feature. I wouldn't expect tracking properties like this.layer to work as, unless it enforces one particular style of object creation there is no way for an IDE to know what this is.

I would suggest in general using the array literal syntax [] in preference to new Array in almost every case. Don't know if that'll help Netbeans though.

0

精彩评论

暂无评论...
验证码 换一张
取 消