Dab tsi yog qhov tshwj xeeb tuav hauv JavaScript?
Dab tsi yog qhov tshwj xeeb tuav hauv JavaScript?

Video: Dab tsi yog qhov tshwj xeeb tuav hauv JavaScript?

Video: Dab tsi yog qhov tshwj xeeb tuav hauv JavaScript?
Video: 1 tsug 13 hnub _part#2_phees lauj fullmusic MV 2022-2023 2024, Kaum ib hlis
Anonim

Thaum a JavaScript nqe lus generates ib qho yuam kev, nws yog hais rau pov ib kev zam . Es tsis txhob mus rau nqe lus tom ntej, lub JavaScript tus txhais lus check rau zam tuav code. Yog tsis muaj kev zam handler , ces qhov kev pab cuam rov qab los ntawm txawm muaj nuj nqi cuam lub kev zam.

Ib yam li ib tug yuav nug, koj ua li cas rau kev zam hauv JavaScript?

Koj ua tau ntes programmer-tsim thiab runtime kev zam , tab sis koj ua tsis tau ntes JavaScript syntax yuam kev. Lub sim thaiv yuav tsum ua raws li los ntawm ib qho raws nraim ntes thaiv los yog ib qho thaum kawg thaiv (los yog ib qho ntawm ob qho tib si). Thaum ib kev zam tshwm sim nyob rau hauv lub sim block, lub kev zam yog muab tso rau hauv e thiab lub ntes block raug tua.

Tsis tas li ntawd, dab tsi yog qhov txawv ntawm qhov yuam kev hauv JavaScript? Muaj peb lub ntsiab hom kev ua yuam kev uas tuaj yeem tshwm sim thaum sau a JavaScript program: syntax yuam kev , runtime yuam kev thiab logical yuam kev.

Ib sab saum toj no, koj txhais li cas los ntawm kev zam kev tuav?

Exception tuav yog tus txheej txheem teb rau kev zam thaum lub computer program khiav. Ib kev zam tshwm sim thaum muaj ib qho kev npaj txhij txog tshwm sim uas yuav tsum tau ua tshwj xeeb. Exception tuav sim ua gracefully kov cov xwm txheej no kom cov kev pab cuam (los yog phem dua, tag nrho cov system) ua tsis sib tsoo.

Ob hom kev ua yuam kev yog dab tsi?

yuam kev - tuav cov txheej txheem rau kev txhim kho yuam kev suav nrog kev nyeem ntawv nruj heev. yuam kev - tuav cov txheej txheem rau logic yuam kev los yog kab mob feem ntau yog los ntawm daim ntawv thov kev debugging lossis kev daws teeb meem.

Muaj plaub pawg tseem ceeb ntawm kev ua yuam kev:

  • Logical yuam kev.
  • Tsim cov yuam kev.
  • Compile-time yuam kev.
  • Runtime yuam kev.

Pom zoo: