Variables (let, const, var)
Variables are containers for storing data values. JavaScript has three ways to declare variables: let, const, and var.
let - Block-Scoped Variables
Use let for variables that can be reassigned:
Loading JavaScript Playground...
const - Constants
Use const for values that shouldn't change:
Loading JavaScript Playground...
var - Legacy Variables
var is the old way to declare variables. Prefer let and const instead:
Loading JavaScript Playground...
Naming Rules
Variable names must follow these rules:
Loading JavaScript Playground...
Exercise: Create Variables
Create three variables and print them:
Loading JavaScript Exercise...
Exercise: Const vs Let
Use const for a fixed value and let for a changing value:
Loading JavaScript Exercise...
التالي · الدرس 5 من 37
Numbers
قراءة 1 دقيقة
أنهيت 4 من 37 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

