From the course: JavaScript Essential Training
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Conditional if...else statement - JavaScript Tutorial
From the course: JavaScript Essential Training
Conditional if...else statement
- [Narrator] Much of programming centers around conditional logic statements. If this condition is true, then do this. If not, then do the other thing. The if else statement is the most basic and probably most used conditional statement in JavaScript and most other programming languages. So let's take a closer look at how this works 'cause you'll use it all the time. In the exercise files for this movie, I've brought back our backpack packer example. Now, if we look at it in the browser, there's one thing in this example that's really irking me and it's down here at the bottom. It says lid status: false. This makes sense if you know what it means, but it's not really the way we would communicate the lid status. We would say lid status open or closed, right? Now, the reason why it says false is because in the code we're just outputting the value of this property inside the everyday pack object. And it's a Boolean value…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
The real-world function2m 49s
-
(Locked)
Functions and methods6m 23s
-
(Locked)
A standard function3m 53s
-
(Locked)
The arrow function4m 49s
-
(Locked)
Arrow functions and "this"4m 20s
-
(Locked)
Practice: Build a function1m 31s
-
(Locked)
Pass data to a function with parameters4m 56s
-
(Locked)
Return values from a function7m 1s
-
(Locked)
Practice: Pass values between functions2m 33s
-
(Locked)
Callbacks5m 29s
-
(Locked)
Conditional if...else statement5m 52s
-
(Locked)
Logical operators3m 31s
-
(Locked)
Conditional switch statement5m 55s
-
(Locked)
Looping through content5m 19s
-
(Locked)
Using the map() array method4m 52s
-
(Locked)
Challenge intro: Create a content factory2m 36s
-
(Locked)
Solution: Create a content factory5m 21s
-
-
-
-