我们邀请“ Javascript开发人员基础”课程的未来学生参观演示日,在此期间,您可以了解有关学习过程和课程计划的更多信息,并向我们的专家提问。
同时,我们准备了一篇有趣文章的传统翻译。
, 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.