Put in order · JavaScript and TypeScript course · Module 1: JavaScript Basics

Stages of Working with Variables

Arrange the stages of working with variables in JavaScript:

Items to put in order

  • Use the variable in an expression
  • Display the result using console.log()
  • Assign a value (e.g., string, number)
  • Declare a variable (let or const)
Show the answer

Correct order:

  1. Declare a variable (let or const)
  2. Assign a value (e.g., string, number)
  3. Use the variable in an expression
  4. Display the result using console.log()