JavaScript學習--標識符、關鍵字、保留字

來源:互聯網
上載者:User

標籤:

本人初學者,部落格隨筆基本都是記錄自己的學習知識,初級水平。大神請忽略,謝謝。

*標識符

所謂標識符,就是指變數、函數、屬性名稱字,或者函數的參數。

    第一個字元必須是字母、下滑線、貨幣符號。

    其他字元可以是字母、下滑線、貨幣符號或數字。

 

*關鍵字

關鍵字用於表示控制語句的開始和結束,或者用於執行特定操作等。不能用作標識符。

1 <script>2      var        new         instanceof       typeof3      try        catch       throw            finally     4      return     void        continue         for         5      switch     case        break            default    6      do         while       debugger         function    7      this       with        if               else                8      in         delete          9 </script>

 

*保留字

另外一組不能被用作標識符的保留字,他們很有可能在將來被用作關鍵字。ECMA-262第3版定義的全部保留字:

1      abstract    enum        int          short 2      boolean     export      interface    static3      byte        extends     long         super4      char        final       native       synchronized5      class       float       package      throws6      const       goto        private      transient7      public      implements  protected    volatile8      double      import      public

 

JavaScript學習--標識符、關鍵字、保留字

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.