Dab tsi yog qhov tsis raug ntaus yuam kev hauv JavaScript?
Dab tsi yog qhov tsis raug ntaus yuam kev hauv JavaScript?

Video: Dab tsi yog qhov tsis raug ntaus yuam kev hauv JavaScript?

Video: Dab tsi yog qhov tsis raug ntaus yuam kev hauv JavaScript?
Video: Leng Yang - Yog Vim Dab Tsi (Official Full Song | Nkauj Tawm Tshiab) 2020/05/24 2024, Kaum ib hlis
Anonim

Uncaught txhais tau tias yuam kev tsis tau ntes tau nyob rau hauv daim ntawv catch, thiab TypeError yog cov yuam kev npe. undefined tsis muaj nuj nqi: Qhov no yog cov lus ntu. Nrog yuam kev cov lus, koj yuav tsum tau nyeem lawv cov lus. Piv txwv li nyob rau hauv cov ntaub ntawv no nws txhais tau hais tias cov code sim siv undefined zoo li nws yog ib tug muaj nuj nqi.

Hauv qhov no, hom kev ua yuam kev hauv JS yog dab tsi?

Tib yam mus rau hauv JavaScript ! Yog tias koj ntxiv 1 thiab H hauv JavaScript lossis thaum koj sim ua haujlwm ntawm ob qhov kev ua haujlwm tsis sib xws hom , JavaScript pov a TypeError . Rau MDN: 'A TypeError raug pov tseg thaum ib qho kev ua haujlwm lossis kev sib cav dhau mus rau qhov ua haujlwm tsis sib haum nrog hom xav tau los ntawm tus neeg teb xov tooj lossis kev ua haujlwm.

Tsis tas li ntawd, Cannot read property of undefined txhais li cas? Uncaught TypeError: Nyeem tsis tau cov cuab yeej 'tsis' ntawm tsis tau txhais . Hauv cov ntsiab lus tseem ceeb, undefined txhais tau tias tias qhov sib txawv tau tshaj tawm tab sis tseem tsis tau muab tus nqi.

Ib yam li ntawd, tib neeg nug, tsis yog kev ua haujlwm hauv JS?

Qhov tseeb, koj muaj a muaj nuj nqi pointer hauv EAX, txij li thaum lub JS cav tsis tuaj yeem qhia tias qhov sib txawv ntawm lub sijhawm sib sau - nws tsuas tuaj yeem paub thaum lub sijhawm khiav. Nws txhais tau tias, lus, nws tsis yog ib txoj haujlwm ! Qhov ntawd txhais tau tias koj tab tom ua ib yam dab tsi (abbreviated) zoo li no: muaj nuj nqi foo(){

Hom kev ua yuam kev yog dab tsi?

Nyob rau hauv statistical hypothesis test, a hom Kuv yuam kev yog qhov tsis lees paub qhov tseeb null hypothesis (tseem hu ua "false positive" nrhiav lossis xaus), thaum hom II yuam kev yog qhov tsis lees paub ntawm qhov tsis tseeb qhov kev xav tsis tseeb (tseem hu ua "false negative" nrhiav lossis xaus).

Pom zoo: