Skip to content
Clairos Learn

12 lessons · Web foundations

JavaScript basics

Variables, functions, conditions, arrays, and readable behavior patterns.

What you will practice

Constants; Mutable values; Readable strings; Number calculations.

Use the worked examples when needed, then test your understanding without them.

  1. 01JavaScript basics: Constantsconst prevents reassignment of a binding. It does not deeply freeze an object stored in that binding.Practice
  2. 02JavaScript basics: Mutable valueslet allows a value to change; choose it when reassignment is part of the task.Practice
  3. 03JavaScript basics: Readable stringsStrings represent text; quotes delimit the value, while concatenation combines text without changing its meaning.Practice
  4. 04JavaScript basics: Number calculationsArithmetic operates on numbers. Converting units explicitly keeps an otherwise correct expression from answering the wrong question.Practice
  5. 05JavaScript basics: Boolean decisionsComparisons produce booleans. Strict equality avoids implicit conversion when checking a known type.Practice
  6. 06JavaScript basics: Conditional branchesAn if statement chooses a path from a condition; the else branch handles the other case.Practice
  7. 07JavaScript basics: ArraysArrays hold ordered values. Index zero refers to the first item.Practice
  8. 08JavaScript basics: Array lengthlength counts the array slots; the last valid index is normally length minus one.Practice
  9. 09JavaScript basics: Named functionsA named function groups a reusable operation; calling it runs its body.Practice
  10. 10JavaScript basics: Function parametersParameters let the same function work with different inputs without duplicating its body.Practice
  11. 11JavaScript basics: Return valuesreturn supplies a result to the caller. A function without an executed return yields undefined.Practice
  12. 12JavaScript basics: Template stringsBacktick template strings can interpolate expressions with ${...}; ordinary quoted strings do not interpolate them.Practice