Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
199 views
in Technique[技术] by (71.8m points)

javascript - JavaScript和ECMAScript有什么区别?(What is the difference between JavaScript and ECMAScript?)

What's the difference between ECMAScript and JavaScript?

(ECMAScript和JavaScript有什么区别?)

From what I've deduced, ECMAScript is the standard and JavaScript is the implementation.

(根据我的推论,ECMAScript是标准,JavaScript是实现。)

Is this correct?

(这个对吗?)

  ask by Guy translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think a little history lesson is due.

(我认为有一点历史课是应该的。)

JavaScript was originally named Mocha and changed to Livescript but ultimately became JavaScript.

(JavaScript最初称为Mocha,后来更改为Livescript,但最终成为JavaScript。)

It's important to note that JavaScript came before ECMAscript and the history will tell you why.

(请务必注意,JavaScript早于ECMAscript,历史记录会告诉您原因。)

To start from the beginning, JavaScript derived its name from Java and initially Brendan Eich (the creator of JS) was asked to develop a language that resembled Java for the web for Netscape.

(从一开始,JavaScript就从Java衍生了它的名称,最初,Brendan Eich(JS的创建者)被要求为Netscape开发一种类似于Java的语言。)

Eich, however decided that Java was too complicated with all its rules and so set out to create a simpler language that even a beginner could code in. This is evident in such things like the relaxing of the need to have a semicolon.

(然而,Eich认为Java的所有规则都过于复杂,因此着手创建一种甚至初学者也可以编写代码的简单语言。这在诸如放宽对分号的要求等方面很明显。)

After the language was complete, the marketing team of Netscape requested Sun to allow them to name it JavaScript as a marketing stunt and hence why most people who have never used JavaScript think it's related to Java.

(语言完成后,Netscape的营销团队要求Sun允许他们将JavaScript命名为营销特技,因此为什么大多数从未使用过JavaScript的人都认为JavaScript与Java有关。)

About a year or two after JavaScript's release in the browser, Microsoft's IE took the language and started making its own implementations such as JScript.

(在浏览器中发布JavaScript大约一两年之后,微软的IE就采用了该语言,并开始制作自己的实现,例如JScript。)

At the same time, IE was dominating the market and not long after Netscape had to shut its project.

(同时,IE主导了市场,而Netscape必须关闭其项目不久。)

Before Netscape went down, they decided to start a standard that would guide the path of JavaScript, named ECMAScript.

(在Netscape崩溃之前,他们决定启动一个指导JavaScript路径的标准,称为ECMAScript。)

ECMAScript had a few releases and in 1999 they released their last version (ECMAScript 3) before they went into hibernation for the next 10 years.

(ECMAScript有几个版本,1999年他们发布了最后一个版本(ECMAScript 3),然后在接下来的10年中进入休眠状态。)

During this 10 years, Microsoft dominated the scenes but at the same time they weren't improving their product and hence Firefox was born (led by Eich) and a whole heap of other browsers such as Chrome, Opera.

(在这10年中,微软占据了主导地位,但与此同时,他们并没有提高产品质量,因此Firefox诞生了(由Eich领导),并诞生了其他许多浏览器,例如Chrome,Opera。)

ECMAScript released its 5th Edition in 2009 (the 4th edition was abandoned) with features such as strict mode.

(ECMAScript在2009年发布了第5版(第4版已被放弃),它具有严格模式等功能。)

Since then, ECMAScript has gained a lot of momentum and is scheduled to release its 6th Edition in a few months from now with the biggest changes its had thus far.

(从那时起,ECMAScript获得了巨大的发展动力,并计划在从现在起的几个月内发布其第六版,这是迄今为止的最大变化。)

You can use a list of features for ECMAScript 6 here http://kangax.github.io/es5-compat-table/es6/ and also the browser support.

(您可以在http://kangax.github.io/es5-compat-table/es6/上使用ECMAScript 6的功能列表,以及浏览器支持。)

You can even start writing Ecmascript 6 like you do with CoffeeScript and use a compiler to compile down to Ecmascript 5.

(您甚至可以像使用CoffeeScript一样开始编写Ecmascript 6,并使用编译器将其编译为Ecmascript 5。)

Whether ECMAScript is the language and JavaScript is a dialect is arguable, but not important.

(ECMAScript是语言还是JavaScript是方言是有争议的,但并不重要。)

If you continue to think like this it might confuse you.

(如果您继续这样思考,可能会使您感到困惑。)

There is no compiler out there that would run ECMAScript, and I believe JavaScript is considered the Language which implements a standard called ECMAScript.

(那里没有可以运行ECMAScript的编译器,我相信JavaScript被认为是实现称为ECMAScript的标准的语言。)

There are also other noticeable languages that implement ECMAScript such as ActionScript (used for Flash)

(还有其他实现ECMAScript的引人注目的语言,例如ActionScript(用于Flash))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...