Maximum length of variable name in JavaScript

后端 未结 2 697
名媛妹妹
名媛妹妹 2020-12-10 00:14

What is the maximum length of a variable name in JavaScript?

2条回答
  •  星月不相逢
    2020-12-10 00:48

    I've tried the example above, x10 the amount of characters, then again, then again, then again.

    When the variable length is of 513k characters, my Notepad++ is slugging along like a snail. Yet when I managed to save the file and run it locally, the alert appears without any delay.

    Tested on: Chrome 19.0.1084.52, IE9, FireFox 11.0, Safari 5.1.5, Opera 11.62

    Since JSBin only allows a maximum of 65535 characters within the tags, I only managed to create a page with a 32.5k length variable: http://jsbin.com/ukunow/10

提交回复
热议问题