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

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay