Course Content
Introduction to JavaScript
Introduction to JavaScript
Task - Declare a Boolean Value
Swipe to start coding
The given code contains a conditional expression which we have not studied yet, so you don't have to worry about understanding it right now.
The code represents a program which displays "The product is available" if the variable isAvailable
is true, otherwise it displays "The product is out of stock.".
Your task is:
- Declare a new variable called
isAvailable
which is set totrue
;
Solution
Thanks for your feedback!
Task - Declare a Boolean Value
Swipe to start coding
The given code contains a conditional expression which we have not studied yet, so you don't have to worry about understanding it right now.
The code represents a program which displays "The product is available" if the variable isAvailable
is true, otherwise it displays "The product is out of stock.".
Your task is:
- Declare a new variable called
isAvailable
which is set totrue
;
Solution
Thanks for your feedback!