• in
InterCourses
CoursesBlogs
0
← Introduction to JavaScript
○What is JavaScript?○Your First JavaScript Code○Data Types○Type Checking
●Declaring Variables○let and const in Practice○Operators○Type Conversion
○Conditionals○Switch Statement○For Loops○While Loop○Break and Continue
○Defining Functions○Arrow Functions○Scope○Closures○Project - Calculator○Function Expressions
○Arrays○Array Mutation Methods○Array Search and Slice○Array Iteration Methods○Multidimensional Arrays○Destructuring○Array Reverse and Sort○Array Fill○Array Find and Includes○Array Flat and FlatMap○Array Reduce, Some, and Every
○Objects○Object Methods and Destructuring○JSON○Math and Date○Date Basics
○02 Template Literals○String Methods○Regular Expressions
○Higher-Order Functions○Callbacks○map, filter, and reduce○Recursion○Project - Data Transform Pipeline
○OOP Introduction○Classes○Inheritance○Encapsulation
○Asynchronous JavaScript○Promises and Async Await○Async API Simulation

Declaring Variables

Variables give names to values so you can reuse and change them. This lesson uses one const and one let so learners can see both styles in action.

Example

javascript
const favoriteFood = "tacos";
let favoriteNumber = 5;
favoriteNumber = 8;

Your Task

  1. Declare favoriteFood as tacos and favoriteNumber as 5, then update favoriteNumber to 8.
  2. Display tacos | 8 in #output.
Hint 1
1 / 2
HINT 1

Use const for the food because it does not change.

Loading editor…
READY
intercourses
javascript