Demo: Boolean logic with switch and other syntax [28 of 51] | JavaScript for Beginners

preview_player
Показать описание
Beyond the core syntax for if statements, JavaScript offers a couple of different ways to write it, and provide multiple branches using a concise form of syntax known as a switch statement. We'll show off the different options available to you.

#JavaScript #Beginners #Tutorial #NodeJS
Рекомендации по теме
Комментарии
Автор

Chris is just phenomenal at explaining programming concepts... I also love when he collaborates with Susan ...

sigmiami
Автор

Very cool this series for beginners. 💪💪👍👍

cursosprogramacion
Автор

At 1:46 looks like you did cut/paste operations. Alt+up/down works much better for moving lines.

AdamsTaiwan
Автор

Thank you for your explanations! Very clear =)

fatimacristina
Автор

Good work :) Pls make more tutorials like this. I want to see all languages tutorial on this channel. Can i get ?

DeepakKumar-dfpy
Автор

When should you use either of these, versus try..catch..finally?

DavidUebergang
Автор

You changed it from and && demo into an || demo which was a bit confusing...

bitsandbytesuk
Автор


const status = 505;
switch (true) {
case status <= 200:
console.log('Low priority status');
break;
case status >= 500 && status <= 600:
console.log('Status in critical range!');
break;
}

//evaluating an object's properties
const status2 = { currentLevel: 505, safeLevel: 200, criticalLevel: 500 };
switch (true) {
case status2.currentLevel <= status2.safeLevel:
console.log("Low priority status");
break;
case status2.currentLevel >= status2.criticalLevel:
console.log("Status is critical!");
break;
}

alaskadan
Автор

This video, which was fine by the way 🙂, just convinced me finally. NEVER to use JavaScript for ANYTHING, it’s just awful 🥺. Thank goodness for Blazor, c# and TypeScript 😎

portlyoldman
Автор

Why not make videos on MS languages like VB instead of languages every dev wants to move away from, aka JavaScript.

astantine
welcome to shbcf.ru