我是靠谱客的博主 简单网络,这篇文章主要介绍JS中的关键字和保留字,现在分享给大家,希望可以做个参考。

关键字

关键字可用于表示控制语句的开始或结束,或用于执行特定操作等。关键字不能用作标识符。

  • break
  • case
  • catch
  • continue
  • debugger(第五版新增关键字)
  • default
  • delete
  • do
  • else
  • finally
  • for
  • function
  • if
  • in
  • instanceof
  • new
  • return
  • switch
  • this
  • throw
  • try
  • typeof
  • var
  • void
  • while
  • with

保留字

保留字有可能将来被用作关键字,也不能用作标识符,以下是ECMA-262第三版定义的保留字:

  • abstract
  • boolean
  • byte
  • char
  • class
  • const
  • debugger
  • double
  • enum
  • export
  • extends
  • final
  • float
  • goto
  • implements
  • import
  • int
  • interface
  • long
  • native
  • package
  • private
  • protected
  • public
  • short
  • static
  • super
  • synchronized
  • throws
  • transient
  • volatile

最后

以上就是简单网络最近收集整理的关于JS中的关键字和保留字的全部内容,更多相关JS中内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(69)

评论列表共有 0 条评论

立即
投稿
返回
顶部