Javascript 什么是 ECMAScript?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4269150/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 11:39:47  来源:igfitidea点击:

What is ECMAScript?

javascript

提问by Jason

In Visual Studio when I am setting my script type to JavaScript this comes up as an option in intellisense.

在 Visual Studio 中,当我将脚本类型设置为 JavaScript 时,这会作为智能感知中的一个选项出现。

A quick Google search came up with lame results, leading me to believe this isn't terribly popular to use.

快速的谷歌搜索得出了蹩脚的结果,让我相信这并不是非常受欢迎。

  • What is it?
  • Does anyone use it? (<script type="text/ecmascript">)
  • Why?
  • 它是什么?
  • 有人使用它吗? (<script type="text/ecmascript">)
  • 为什么?

回答by meder omuraliev

JavaScript is a subset of ECMAScript. JavaScript is basically ECMAScript at its core but builds upon it. Languages such as ActionScript, JavaScript, JScript all use ECMAScript as its core. As a comparison, AS/JS/JScript are 3 different cars, but they all use the same engine... each of their exteriors is different though, and there have been several modifications done to each to make it unique.

JavaScript 是 ECMAScript 的一个子集。JavaScript 的核心基本上是 ECMAScript,但建立在它之上。ActionScript、JavaScript、JScript 等语言都以 ECMAScript 为核心。作为比较,AS/JS/JScript 是 3 种不同的汽车,但它们都使用相同的引擎……虽然它们的外观各不相同,但它们都经过多次修改以使其独一无二。

The history is, Brendan Eich created Mocha which became LiveScript, and later JavaScript. Netscape presented JavaScript to Ecma International, which develops standards and it was renamed to ECMA-262 aka ECMAScript.

历史是,Brendan Eich 创建了 Mocha,它变成了 LiveScript,后来变成了 JavaScript。Netscape 向Ecma International展示了 JavaScript ,后者开发了标准,并将其重命名为 ECMA-262 aka ECMAScript。

It's important to note that Brendan Eich's "JavaScript" is not the same JavaScript that is a dialect of ECMAScript. He built the corelanguage which was renamed to ECMAScript, which differs from the JavaScript which browser-vendors implement nowadays.

需要注意的是,Brendan Eich 的“JavaScript”与作为 ECMAScript 方言的 JavaScript 不同。他构建了重命名为 ECMAScript的核心语言,这与当今浏览器供应商实现的 JavaScript 不同。

http://en.wikipedia.org/wiki/ECMAScript

http://en.wikipedia.org/wiki/ECMAScript

回答by Daniel A. White

ECMAScript is a standard. JavaScript and ActionScript are well-known implementationsof the ECMAScript standard.

ECMAScript 是一个标准的. JavaScript和ActionScript中是众所周知的实现ECMAScript标准的。

http://en.wikipedia.org/wiki/ECMAScript

http://en.wikipedia.org/wiki/ECMAScript

回答by Mahmoud Zalt

ECMAScript = ES:

ECMAScript = ES:

  • ECMAScript?is?a Standard?for?a?scripting?languages.

  • Languages like Javascript are based?on?the?ECMAScript?standard.

  • ECMA Standard is based?on?several?originating?technologies, the?most?well?known?being?JavaScript?(Netscape)?and?JScript?(Microsoft).

  • ECMA means?European?Computer?Manufacturer's?Association

  • ECMAScript 是一种标准,适用于脚本语言。

  • 像 Javascript 这样的语言是基于 ECMAScript 标准的。

  • ECMA 标准基于?几个?起源?技术,最知名的?正在?JavaScript?(Netscape)?和?JScript?(微软)。

  • ECMA 的意思是?欧洲?计算机?制造商?协会



On the other side:

另一方面:



JavaScript = JS:

JavaScript = JS:

  • JavaScript is the most popular implementations of the ECMAScript Standard.

  • The?core?features?of?Javascript?are?based?on?the?ECMAScript?standard,? but?Javascript?also?has?other?additional?features?that?are?not?in the?ECMA specifications/standard.

  • ActionScript and?JScript are another languages that implements the?ECMAScript.

  • JavaScript was submitted to?ECMA for standardization but due to?trademark?issues with?the?name?Javascript the?standard?became?called?ECMAScript.

  • Every?browser?has?a?JavaScript?interpreter.

  • JavaScript 是 ECMAScript 标准最流行的实现。

  • 核心?功能?Javascript?是基于?基于?ECMAScript?标准,?但是?Javascript?也有?其他?附加?功能?那?不是?在ECMA 规范/标准中。

  • ActionScript 和?JScript 是另一种实现?ECMAScript 的语言。

  • JavaScript 被提交给?ECMA 进行标准化,但由于?商标?问题?该?名称?Javascript 标准?被称为?ECMAScript。

  • 每个?浏览器?都有?一个?JavaScript?解释器。



For more details on this checkout my full answer here What is the difference between JavaScript and ECMAScript?

有关此结帐的更多详细信息,请在此处查看我的完整答案JavaScript 和 ECMAScript 之间的区别是什么?

回答by Krishna

ECMA stands for - European Computer Manufacturer's Association. ECMAScript is a standard for a scripting language. It specifies the core features that a scripting language should provide and how those features should be implemented. Javascript was originally created at Netscape, and they wanted to standardize the language. So, they submitted the language to the European Computer Manufacturer's Association (ECMA) for standardization. But, there were trademark issues with the name Javascript, and the standard became called ECMAScript, which is the name it holds today as well.

ECMA 代表 - 欧洲计算机制造商协会。ECMAScript 是脚本语言的标准。它指定了脚本语言应该提供的核心功能以及应该如何实现这些功能。Javascript 最初是在 Netscape 中创建的,他们希望对语言进行标准化。因此,他们将该语言提交给欧洲计算机制造商协会 (ECMA) 进行标准化。但是,Javascript 这个名称存在商标问题,该标准被称为 ECMAScript,这也是它今天的名称。

So you can use any scripting language that implements the ECMA standard as the web browsers support the ECMAScript interpretation when you are specifying (<script type="text/ecmascript">).

因此,您可以使用任何实现 ECMA 标准的脚本语言,因为当您指定 ( <script type="text/ecmascript">)时,Web 浏览器支持 ECMAScript 解释。

回答by cateof

ECMA is the orgranization that standarized JavaScript. They named the language ECMAScript, however the "JavaScript" was the term that won the "name competition"

ECMA 是标准化 JavaScript 的组织。他们将语言命名为 ECMAScript,但是“JavaScript”是赢得“名称竞赛”的术语

回答by haferblues

Here is a different view on this topic. It's more or less from experience, I cannot quote anything. Any JavaScript validator and everybody who works with JavaScript will tell you that

关于这个话题,这里有不同的看法。它或多或少来自经验,我不能引用任何内容。任何 JavaScript 验证器和使用 JavaScript 的每个人都会告诉你

alert("hello World");

is valid JavaScript. And I'd also agree.

是有效的 JavaScript。我也同意。

However, a ECMAScript validator will probably tell you it is not valid, because alert() is not part of the ECMAScript, but a typically feature of JavaScript for Browsers. There are many features of JavaScript, which make only sense in a browser environment, f.i. window.navigator, window.document, WebSocket, navigator.geolocation. Some would even say, this is not part fo JavaScript, but part of HTML5, which is not true, because HTML5 is just the markup language. However, these fancy new features are often called HTML5, even though they are implemented in JavaScript.

但是,ECMAScript 验证器可能会告诉您它无效,因为 alert() 不是 ECMAScript 的一部分,而是 JavaScript 浏览器的典型功能。JavaScript 有很多特性,只在浏览器环境下才有意义,比如 window.navigator、window.document、WebSocket、navigator.geolocation。甚至有人会说,这不是 JavaScript 的一部分,而是 HTML5 的一部分,这不是真的,因为 HTML5 只是标记语言。然而,这些花哨的新功能通常被称为 HTML5,即使它们是用 JavaScript 实现的。

JavaScript can also be used for server side scripting. Then all the geolcation or media apis make no sense. So JavaScript for server side scripting is much closer to ECMAScript again, which doesn't have this typical browser features.

JavaScript 也可用于服务器端脚本。那么所有的地理定位或媒体 API 都没有意义。因此,用于服务器端脚本编写的 JavaScript 再次更接近于 ECMAScript,后者没有这种典型的浏览器功能。

I couldn't really find out, whether the Math object (e.g. Math.sqrt(9)) is part of ECAMScript, or whether ECMAScript really just defines the syntax of the language and has no build in functionality whatsoever. But one ECMAScript validator accepted Math.sqrt(9) as valid ECMAScript, whereas var test=window.document; failed the ECMA validation.

我真的无法确定 Math 对象(例如 Math.sqrt(9))是否是 ECAMScript 的一部分,或者 ECMAScript 是否真的只是定义了语言的语法而没有任何内置功能。但是一个 ECMAScript 验证器接受 Math.sqrt(9) 作为有效的 ECMAScript,而 var test=window.document; ECMA 验证失败。

Even though the following link it to a JavaScript documentation, this in my opinion is the build in feature set (objects and functions) of ECMAScript:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects

尽管以下将其链接到 JavaScript 文档,但我认为这是 ECMAScript 的内置功能集(对象和函数):https: //developer.mozilla.org/en-US/docs/Web/JavaScript/Reference /Global_Objects

So in my opinion JavaScript is very closely tied to browsers, whereas ECMAScript has really only a very basic set of functionality (if at all).

所以在我看来 JavaScript 与浏览器的联系非常紧密,而 ECMAScript 实际上只有一组非常基本的功能(如果有的话)。