ai code academy · Explore coding

JavaScript let, const, and var

JavaScript variables give names to values. They make it easier to describe information a program needs, including details that may change while someone uses it.

Discover ai code academyYour next step: guided practice and AI support in the app.

Download on the App Store ↗

Where this idea appears

A selected item, a running count, and a page title are different pieces of information. Naming them clearly makes the behaviour behind an interface easier to follow.

A changing value can keep the same purpose

A variable connects a name to information used by a program. The selected category may change from books to music while still representing the same choice in the interface. A useful name describes that role, rather than only describing the first value it receives.

JavaScript also distinguishes bindings that can be reassigned from those that cannot. That distinction concerns the name's connection to a value; it does not make every object associated with a fixed binding unchangeable. These are separate parts of understanding how state evolves.

Take your next step with ai code academy

Comfort with basic values helps when exploring any coding project. Discover guided practice and AI support in ai code academy.

Source

Explore related topics