1. 程式人生 > >JavaScript筆記3--標識符和保留字

JavaScript筆記3--標識符和保留字

package catch abs var con syn init ace fine

1.標識符
javaScript標識符必須以字母,下劃線(_)或美元符($)開始.後續的字符可以是字母/數字/下劃線/美元符.也可以使用非英語語言或數學符號來書寫標識符;

2.保留字
break/delete/function/return/typeof/case/do/if/switch/var/catch/else/in/this/void/continue/false/instanceof/throw/while/debugger/finally/
new/true/with/default/for/null/try

3.ECMAScript5保留了以下關鍵字:
class/const/enum/export/extends/import/super

4.嚴格模式下的關鍵字:
implements/let/private/public/yield/interface/package/protected/static/arguments/eval

5.ECMAScripts3保留了以下關鍵字:
abstract/double/goto/native/static/boolean/enum/implements/package/super/byte/export/import/private/synchronized/char/extends/int/protected/throws/class/final/interface/public/transient/const/float/long/short/volatile

6.預定義的全局變量和函數名,應避免使用作為自己的標識符:
arguments/encodeURI/Infinity/Number/RegExp/Array/encodeURIComponent/isFinite/Object/String/Boolean/Error/isNaN/parseFloat/SyntaxError/Date/eval/JSON/parseInt/TypeError/decodeURI/EvalError/Math/RangeError/undefined/decodeURIComponent/Function/NaN/ReferenceError/URIError

JavaScript筆記3--標識符和保留字