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

來源:互聯網
上載者:User

標籤:throws   throw   全域變數   自己的   long   math   函數   ransient   nat   

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.strict 模式下的關鍵字:
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--標識符和保留字

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.