We invite future students of the course "Javascript Developer. Basic" to visit the demo day , during which you can learn more about the learning process and the course program, as well as ask questions to our experts .
In the meantime, we have prepared a traditional translation of an interesting article.
, ECMAScript 3, ECMAScript 5 . ECMAScript 4 . ?
, ECMAScript 4 , .
ECMAScript 4 , , ECMAScript 3. ECMAScript 3, ES4 .
ES4 , , ES4 .
2008 ES4 , ES3.1 ES5. , ECMAScript.
, ES4 ActionScript 3 Flash-. AS3 , Flash .
?
- ES6, , .
class C {
var val
var number = 500;
const pi = 3.14
// A function
function f(n) { return n+val*2 }
// Getters and setters
function set foo(n) {
val = n;
}
function get foo() {
return val;
}
}
, this. , ES4 , .
ES4 :
static
final
private,
protected
,public
.prototype
β . , , , , - .
ES4 . , Typescript.
interface MyInterface {
function foo();
}
ES4 .
function add(a: int, b:int): int {
return a + b;
}
type
, Typescript. Typescript :
let a : number | string;
ES4 :
var a: (number, string)
ES4 :
class Wrapper<T> {
inner: T
}
Like
ES4 , . like
.
function getCell(coords: like { x: int, y: int }) {
}
, ES4 , , , Typescript.
ES boolean
, object
, array
, number
, BigInt
. ES4 :
byte
int
unit
double
decimal
ES decimal
, , , :
const allowance = 1.50m
ES4 m, (money).
Hello my name is "Evert"
ES4 :
const hi = """Hello my name is "Evert"""";
. , , ES6, .
:
package com.evertpot {
// Private
internal const foo = 5;
class MyClass {
}
}
:
const myObj = com.evertpot.MyClass;
:
import * from com.evertpot;
const myObj = MyClass;
, .
(generic)
. Β« Β» Typescript, .
class Foo {
generic function addItem(x);
function addItem(x: int) {
}
function addItem(x: number) {
}
}
addItem
β int
number
. .
E4X
E4X β ES4, .
E4X ECMAScript XML. , , :
const myClass = 'welcome';
const name = 'Evert';
const foo = <div class={myClass}>{"Hello " + name }</div>;
?
, , JSX, , JSX.
ES4 , E4X Firefox .
let const
. ES5 (const
) .(
yield
)..
, ( XML), .
?
ECMAScript 4 , , ES4:
<script type="text/javascript;version=4" src="..."></script>
:
<script type="module" src="..."></script>
, , JavaScript. ECMAScript: , Typescript JSX, β ECMAScript, 2007 .
, ES4 , Babel, Webpack Typescript.