Cov txheej txheem:

Kuv yuav pib nrog TypeScript li cas?
Kuv yuav pib nrog TypeScript li cas?

Video: Kuv yuav pib nrog TypeScript li cas?

Video: Kuv yuav pib nrog TypeScript li cas?
Video: Qhia saib seb yus tu hlub комментарий thiab nias like rau leej twg 2021 2024, Hlis ntuj nqeg
Anonim

Kev teeb tsa TypeScript

  1. Nruab lub TypeScript compiler. Rau pib off, cov TypeScript compiler yuav tsum tau muab tso rau hauv thiaj li yuav hloov TypeScript cov ntaub ntawv rau hauv cov ntaub ntawv JavaScript.
  2. Xyuas kom tseeb tias koj tus editor tau teeb tsa los txhawb TypeScript .
  3. Tsim ib daim ntawv tsconfig.json.
  4. Transpile TypeScript rau JavaScript.

Tib neeg kuj nug, Kuv yuav pib TypeScript li cas?

Thawj rau cov kauj ruam yog tib yam hauv peb txoj hauv kev, yog li cia peb pib

  1. Kauj ruam 1: Nruab Node. js/npm.
  2. Kauj ruam 2: Nruab Visual Studio Code los yog lwm yam editor.
  3. Kauj ruam 3: Teeb pob.
  4. Kauj ruam 4: Nruab Typescript.
  5. Kauj ruam 5: Nruab React lossis Preact.
  6. Kauj Ruam 6: Sau qee qhov React code.

Tsis tas li ntawd, kuv puas yuav tsum tau nruab TypeScript? Koj yuav tau nruab tus TypeScript compiler thoob plaws ntiaj teb los yog hauv koj qhov chaw ua haujlwm kom hloov pauv TypeScript qhov chaws code rau JavaScript ( tsc HelloWorld. ts). Koj ua tau test koj nruab los ntawm kev txheeb xyuas lub version.

Hais txog qhov no, nws siv sijhawm ntev npaum li cas los kawm TypeScript?

Nws yog qhov nruj syntactical superset ntawm JavaScript, thiab ntxiv kev xaiv zoo li qub rau cov lus, qhov siab tshaj plaws sij hawm lub sij hawm ntawm kawm ntaus ntawv yog 40 mus rau 50 hnub Kawm TypeScript hauv cov kauj ruam yooj yim thiab yooj yim pib los ntawm theem pib mus rau cov ntsiab lus siab dhau los ntawm cov peev txheej online..

Kuv yuav tsum kawm JavaScript lossis TypeScript?

Yog, koj yuav tsum kawm JavaScript ua ntej pib muaj kev paub hauv Sau ntawv . Nws yog ib qho tseem ceeb kom tau txais qhov sib txawv ntawm ob qho tib si los ntawm kev mus, TypeScript ua ib tug statically ntaus superset ntawm JS.

Pom zoo: