Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Javascript 中的保留字
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
gugod  
View profile   Translate to Translated (View Original)
 More options Jul 22 2007, 1:34 am
From: gugod <gugod...@gmail.com>
Date: Sat, 21 Jul 2007 22:34:13 -0700
Local: Sun, Jul 22 2007 1:34 am
Subject: Javascript 中的保留字
偶爾有些時候會把 "class"﹑"default" 這些常用的字拿來做為雜湊的鍵,但其實這兩個字是 Javascript 之中的保留字。因此
有些特別。比如說:

  foo.default

在 IE 之中是文法錯誤,必需要改寫為:

  foo["default"]

值得注意的是,在 Firefox 中兩種寫法都行。不太確定是否有規範規定這種狀態應有的正確行為。也許正確的做法是產生文法錯誤,而這確實是屬於
Javascript Engine 各自實要決定的事項。

以下列出 Javascript 裡面的保留字做備考(取自 http://javascript.about.com/library/blreserved.htm)

    * abstract
    * as
    * boolean
    * break
    * byte
    * case
    * catch
    * char
    * class
    * continue
    * const
    * debugger
    * default
    * delete
    * do
    * double
    * else
    * enum
    * export
    * extends
    * false
    * final
    * finally
    * float
    * for
    * function
    * goto
    * if
    * implements
    * import
    * in
    * instanceof
    * int
    * interface
    * is
    * long
    * namespace
    * native
    * new
    * null
    * package
    * private
    * protected
    * public
    * return
    * short
    * static
    * super
    * switch
    * synchronized
    * this
    * throw
    * throws
    * transient
    * true
    * try
    * typeof
    * use
    * var
    * void
    * volatile
    * while
    * with


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google