Puas yog console log cuam tshuam kev ua haujlwm?
Puas yog console log cuam tshuam kev ua haujlwm?

Video: Puas yog console log cuam tshuam kev ua haujlwm?

Video: Puas yog console log cuam tshuam kev ua haujlwm?
Video: 400 xyoo rov yug los hlub koj (Full movie) 2024, Hlis ntuj nqeg
Anonim

Tab sis ob peb lub console . log 's yuav tsum tsis muaj kev ceeb toom. Yuav siv qhov kev debugging feature lub console . log () yuav txo koj qhov kev pab cuam kev ua tau zoo vim nws yuav siv sij hawm xam phaj.

Ua raws li qhov no hauv kev pom, puas console log ua haujlwm qeeb?

Yog, nws yuav txo qhov ceev, txawm tias tsuas yog negligibly. Tab sis, tsis txhob siv nws vim nws yooj yim heev rau tus neeg nyeem koj cov ntaub ntawv.

Tsis tas li ntawd, lub ntsiab lus ntawm console log yog dab tsi? Cov lub console . log () yog ib txoj haujlwm hauv JavaScript uas yog siv los luam tawm txhua yam kev hloov pauv uas tau hais tseg ua ntej hauv nws lossis tsuas yog luam tawm cov lus uas yuav tsum tau nthuav tawm rau tus neeg siv.

Ntawm no, puas console log qeeb ntawm node?

Raws li hais saum toj no, lub lub console . log yog asynchronous thiab tsis thaiv, yog li nws yuav tsis qeeb koj daim ntawv thov ntau dhau tsuas yog ib qho zuam rau qhov kev thov ua haujlwm. Tab sis nws yog tus cwj pwm zoo los siv qee qhov module los tig qee yam cov ntaub ntawv ntawm tej theem tawm thaum deploy nws nyob rau hauv ntau lawm es tsis txhob siv lub console.

Yuav tsum tau siv lub console log hauv kev tsim khoom?

Yog lawm. lub console . log yuav pov ib qho kev zam rau hauv browsers uas tsis muaj kev txhawb nqa rau nws ( lub console khoom yuav tsis pom). Feem ntau yog, nws tsis yog ib lub tswv yim zoo los nthuav tawm log cov lus hauv koj ntau lawm code.

Pom zoo: