ES6? JavaScript ? ???? ????? ??? ?? ????? ?? ?? ?? ? ? ????. ??? ?? (
??? ?)? ?? ? ?? ??? ???? ?????? ???????. ? ??? ?? TC39 3 ?? : ?? ??? ??? ES2019 (ES10)? ?? ? ????. Node.js 12, Chrome 74 ? Babel? ?? ?? ??? ?????. ??? ??? ??? ????? ???? ?? ES6 ???? ???? ?? ?????. ? ??? 2020 ?? ?????????. ?? ??? ? JavaScript ??? ??? "JavaScript : Newbie?? Ninja, Second Edition"? ?????. ? ??? ES6? JavaScript ? ???? ????? ??? ?? ????? ?? ?? ?? ? ? ????. ES2019? ??? ??? ES2019 (ES10)? ?? ? ??? ?? ? ?? ??? ???? ?????? ???????.
ES2019? ??? ??? ???? ??# ???? ???? ?? ??? ??? ?? ? ? ????. ?? ?? ??? ??? ??? ?? ???? ?? ????? ??? ? ? ????.
??? ???? ???? ???? # ??? ??? ????, ?? ?? ????? ????? ?? ?????. ??? # ??? ??? ?? ???? ???? ?? ?? ??? ???? ????????.
- es6 ???? ?? ??
- ??? ? ??????. ??? ??? ?? ????? ?? ?? ???????? ??? ??? ?????. ???? ?? ??? ??? ???? ??? ???? ?? ???
- ???. ?? ?? ??? ?? ??? ????? (???? ????? ?? ? ?? ??? ???? ?? ?? ???? ?????) :
- ??? ??? ?? ??? ??? ?????. 'Strict ??'? ?? ? ??? ????.
- getter and setter
? ?? ???? ?? ???? ?? ??????. ?????, getter ? ?? ?? ?? ??? ?????. ?? ?? :
?? ??? ?? ?? ???
? ??>
? ??> <<> ES2019 ??? ?? (? ??> new ) ? ??>
<<> ?? ??? ?? ? ??>
? ??> es6 ???? ?? ??? ????? ????
<<> ??? ?? : ???
JavaScript? ?? ??? ??? ?? ?? ?????? ?? ?? ? ????? ???? ?????? ?? ??? ??? ?????. ? ???? ??? ?? ??? ?? ??? ?? ? ???? ???? ?? ? ? ??????. ?? ?? ??? ?? ??? ??? ?? ??? ??? ?? ???? ???? ?? ???? ??? ????? ???? ??? ? ????. ?? ?? ??? ?? ??? ?? ? ?? ? ??? ?? ??? ??? ??? ?????? ????? ? ??? ? ? ????.
JavaScript??
class Animal {
constructor(name = 'anonymous', legs = 4, noise = 'nothing') {
this.type = 'animal';
this.name = name;
this.legs = legs;
this.noise = noise;
}
speak() {
console.log(`${this.name} says "${this.noise}"`);
}
walk() {
console.log(`${this.name} walks on ${this.legs} legs`);
}
}
<<> ?? ??? ? ?? let rex = new Animal('Rex', 4, 'woof');
rex.speak(); // Rex says "woof"
rex.noise = 'growl';
rex.speak(); // Rex says "growl"
???? ?? ??? getter? ?? ?? ??? ?? ?????.
class Animal {
constructor(name = 'anonymous', legs = 4, noise = 'nothing') {
this.type = 'animal';
this.name = name;
this.legs = legs;
this.noise = noise;
}
speak() {
console.log(`${this.name} says "${this.noise}"`);
}
walk() {
console.log(`${this.name} walks on ${this.legs} legs`);
}
// setter
set eats(food) {
this.food = food;
}
// getter
get dinner() {
return `${this.name} eats ${this.food || 'nothing'} for dinner.`;
}
}
let rex = new Animal('Rex', 4, 'woof');
rex.eats = 'anything';
console.log( rex.dinner ); // Rex eats anything for dinner.
class Human extends Animal {
constructor(name) {
// 調(diào)用Animal構(gòu)造函數(shù)
super(name, 2, 'nothing of interest');
this.type = 'human';
}
// 重寫Animal.speak
speak(to) {
super.speak();
if (to) console.log(`to ${to}`);
}
}
?? ??? ????? ?? ??? ?? ? ? ????. ES6??? ?????? ???? ?? ?? ??? (_propertyName), ???, ?? ?? ??? ?? ??? ??? ?????. ??? ????? ??? ????? ???? ???? ?? ?? ?? ????. ES2019?? ?? ??? ??? ??# ???? ???? ?????.
let don = new Human('Don');
don.speak('anyone'); // Don says "nothing of interest" to anyone
don.eats = 'burgers';
console.log( don.dinner ); // Don eats burgers for dinner.
class Animal {
constructor(name = 'anonymous', legs = 4, noise = 'nothing') {
this.type = 'animal';
this.name = name;
this.legs = legs;
this.noise = noise;
}
speak() {
console.log(`${this.name} says "${this.noise}"`);
}
walk() {
console.log(`${this.name} walks on ${this.legs} legs`);
}
}
?, JavaScript ???? ?? ? ?? ??? ?? ?? ? ????. ?? ??? ?? ??? ?? ???? ????? ?? (#) ???? ????. ??? ????? ??? ? ??? ?? ??? ?? ?? ??? ????? ??? ?? ? ???? ??? ? ????.
? ??? ?? ??? ??? ??? ???? ??? ??? ????? ???? ????? ?????.
? ??? JavaScript? ??? ?? ??? ?? ? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.

.map (), .filter () ? .reduce ()? ?? JavaScript ?? ?? ???? ??? ??? ??? ? ? ????. 1) .map ()? ??? ??? ??? ???? ? ??? ???? ? ?????. 2) .filter ()? ???? ??? ????? ? ?????. 3) .reduce ()? ???? ?? ??? ???? ? ?????. ???? ??? ????? ??? ?? ?? ??? ?????.

JavaScript? ??? ??? ?? ??, ? ? ? ?? ???? ???? ??? ??? ?????. 1. ?? ??? ?? ??? ???? ??? ??? ??? ??? ?? WebAPI? ?????. 2. WebAPI? ??????? ??? ?? ? ? ??? ?? ??? (??? ?? ?? ???? ??)? ????. 3. ??? ??? ?? ??? ?? ??? ?????. ?? ??? ??? ????? ??? ??? ?? ? ???? ?????. 4. ???? ?? (? : Promise. 5. ??? ??? ???? ?? ???? ???? ?? ?? ?? ??? ????? ? ??????.
