preface
Believe that a lot of front end -all for ECMAScript, JavaScript, TypeScript quite familiar with this a few word, can be said to be the core technology of our work, but if a specific ask what is the relationship between these three, what is the difference between, I’m afraid a lot of friends, like black, difficult to accurately describe, So xiaohei decided to thoroughly understand their relationship and difference with everyone
The three relations
ECMAScript
ECMAScript, the language defined by ECMA-262, is not limited to Web browsers. In fact, the language has no input and output methods.
Ecma-262 defines this language as a benchmark on which more robust scripting languages can be built. At a basic level, ecMA-262 describes the following parts of the language if the browser is not involved:
- grammar
- type
- statements
- The keyword
- Reserved words
- The operator
- Global object
ECMAScript is just a name for a language that implements all aspects of the specification. It’s actually a language standard. JavaScript implements ECMAScript, Adobe ActionScript implements ECMAScript, and if you want, It is also possible to build a scripting language such as XXScript to implement ECMAScript
JavaScript
While JavaScript and ECMAScript are essentially synonyms in everyday use, JavaScript is much more than what ecMA-262 defines. A complete JavaScript implementation consists of the following parts:
- Core (ECMAScript)
- Document Object Model (DOM)
- Browser Object Model (BOM)
ECMAScript is a scripting language that forms the basis of the JavaScript language, with DOM and BOM forming the complete JavaScript implementation
TypeScript
TypeScript is a superset of JavaScript that adds an optional static typing system, a number of new ECMAScript features (such as decorators) that have not been officially released yet, and will eventually be compiled into JavaScript code.
summary
ECMAScript is the standard language, JavaScript is an implementation of ECMAScript, and TypeScript is a superset of JavaScript.
Small black level is limited, if there are deficiencies and mistakes, please comment!