Course Content
Introduction to JavaScript
4. Conditional Statements
Introduction to JavaScript
Challenge: Define the Variable
Task
- Define a variable named
myVar
and assign the value15
to it. - Print the variable
myVar
to the console.
1. Use the
2. Assign the value 15 to the variable using the assignment operator (
3. Use the
let
keyword to declare a variable. 2. Assign the value 15 to the variable using the assignment operator (
=
). 3. Use the
console.log()
function to print the value of the
variable to the console.
let myVar = 15;
console.log(myVar);
Everything was clear?
Section 2. Chapter 2