Yog xav tau es6?
Yog xav tau es6?

Video: Yog xav tau es6?

Video: Yog xav tau es6?
Video: Hmoob sib deev EP 1 - Hmoob sib aim 2024, Kaum ib hlis
Anonim

Tshwj xeeb, vim ES 6 modules yog loaded, daws thiab ntsuam xyuas asynchronously, nws yuav tsis tau xav tau () ib ES 6 module. Qhov laj thawj yog vim li cas xav tau () yog ib qho kev ua haujlwm siab synchronous.

Ib yam li ntawd, koj tuaj yeem nug, puas siv es6?

ECMAScript 2015 ( ES 6 ) thiab tshaj. Node . js tau tsim tawm tsam niaj hnub versions ntawm V8. Los ntawm kev ua raws li cov kev tshaj tawm tshiab ntawm lub cav no, peb xyuas kom meej cov yam ntxwv tshiab ntawm JavaScript ECMA-262 specification raug coj mus rau Node.

Qhov thib ob, es6 code yog dab tsi? ES 6 hais txog version 6 ntawm ECMA Script programming language. Nws yog ib qho kev txhim kho tseem ceeb rau cov lus JavaScript, thiab ntxiv ntau yam ntxiv rau kev tsim kho software loj loj. ECMAScript, los yog ES 6 , tau luam tawm thaum Lub Rau Hli 2015. Nws tau tom qab hloov npe rau ECMAScript 2015.

Ib yam li ib tug yuav nug, koj yuav tsum siv es6?

Thiab ntawm no yog cov lus teb: ES 6 muaj kev nyab xeeb. Txawm tias koj yog tsom rau cov browser qub qub xws li IE11, koj tseem tuaj yeem siv ES6 nrog lub amazing babel compiler. Nws yog hu ua "compiler" vim nws hloov dua siab tshiab ES 6 code rau ES5 code kom ntev npaum li koj tus browser tuaj yeem txhawb nqa ES5, koj ua tau siv ES6 code yam xyuam xim.

Dab tsi yog xav tau hauv JS?

xav tau () tsis yog ib feem ntawm tus qauv JavaScript API. Tab sis hauv Node. js , nws yog ib qho kev ua haujlwm nrog lub hom phiaj tshwj xeeb: thauj khoom modules. Modules yog ib txoj hauv kev los faib ib daim ntawv thov rau hauv cov ntaub ntawv sib cais es tsis txhob muaj tag nrho koj daim ntawv thov hauv ib cov ntaub ntawv.

Pom zoo: