DEV Community

BekmuhammadDev
BekmuhammadDev

Posted on • Edited on

2 2 2 2 2

Javascript:

Mavzu

  • Loops
  • for loop
  • while
  • do while
  • Functions (Declaration)

SCOPES:
Scopelar 4ta turga bolinadi bular :
1-Global scope
2-Local scope
3-Function scope
4-Block scope
Scope lar quydagicha korinadi :

Image description

Global scope — Hamma kodlar yoziladigan joy

Local scope — Functioni orab turgan joy

Function scope — Function ichida joylashgan qismi

Bloce scops — Biron bir shat yozilsa , Masalan: if elese yokiy for

LOOPS:

JavaScript da asosan ishlatiladigan 3ta loop operatorlari mavjud ular .
1-while
2-do while
3-for operatorlari:

While takrorlanuvchi aperator:while ishlashi

Image description
cansole

Image description

Do while while bilan bir hil ishlaydi farqi shartni oxirida tekshiradi: Do whilening ishlashi

Image description

cansole

Image description

FOR For loop boshqa looplarga qaraganda tez ishlaydi universl loop hisoblanadi va ko'p ishlatiladi:
Forning ishlashi:

Image description

cansole

Image description

FUNCTION DECLERATION
Fuction declaration => bu fuction asosi pilus fuction yaratib uni hohlagan joyda chaqirsak boladi .

Image description
cansole

Image description

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay