JavaScript 1.5 的新特性

3 位贡献者:

这篇翻译不完整。请帮忙从英语翻译这篇文章

以下为JavaScript 1.5 的更新记录. 该版本包含在发行于2000年11月14日的Netscape Navigator 6.0中,也在后续的的Netscape Navigator版本和Firefox 1.0中使用. 你可以拿JavaScript 1.5 和JScript version 5.5 , Internet Explorer 5.5进行比较 , 后者发行于2000年7月. 相应的ECMA 标准是 ECMA-262 Edition 3 (自1999年12月).

JavaScript 1.5 新特性

JavaScript 1.5 功能更新

  • 运行时错误现在作为异常报告.
  • 正则表达式更新:
    • 量词 — +, *, ? 和 {} — 现在可以跟在 ? 后强行使其变为非贪婪模式.
    • Non-capturing parentheses, (?:x) can be used instead of capturing parentheses, (x). When non-capturing parentheses are used, matched subexpressions are not available as back-references.
    • Positive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched.
    • 添加m标记说明正则表达式可以匹配多行.
  • 函数可以在if语句中声明.
  • 函数可以在表达式中声明.

 

文档标签和贡献者

标签: 
向此页面作出贡献: yenshen, teoli, Cnmahj
最后编辑者: yenshen,
隐藏侧边栏