#22 If else Statements | JavaScript Full Tutorial

preview_player
Показать описание
In this lesson we're going to be learning all about the most commonly used Conditional Statement, the if statement. The if statement takes a condition and evaluates whether it is a truthy or falsy value, if it's true then it will run a block of code. We also learn about the variants, if else and else if statements.

------------------



------------------




------------------
Learn with Dev Dreamer! Step by step, easy to understand tutorials :-)
Рекомендации по теме
Комментарии
Автор

This is the 3rd video of yours that i watch and its so much fun. Its a shame you stopped uploading.

RuiCosta
Автор

Hi there, I found your videos really useful, well-explained, and structured.
I like that you give tasks at the end of each video, I personally learn better when struggle with a particular task.
Therefore could you please create videos with lots of tasks? JS mainly, but CSS and HTML are welcome too:)))).
Thank you for your effort and sharing your knowledge.

ralitsadimova
Автор

I know this is an old video, but I came up with this and it worked. Am I wrong, I didn't need another variable.

let myName = `Stanley`;
if (myName.length > 5) {
console.log(`More than 5 letters`);

stanleytomasetti
Автор

Do you give certifications after someone has completed your full course

moleendhadhaya
Автор

//#1
let num = 10 + 2;
if (num > 2 && num < 20) {
console.log("TRUE");
} else {
console.log("FALSE");
}
//output:- TRUE

//#2
let user = 'employee';
if (user === 'guess') {
console.log("Login Denied");
} else if(user === 'employee') {
console.log("Sucessfully Logged in");
}
//output:- Sucessfully Logged in


//#3
const myName = "Robin";
let lengthName = myName.length;
if (lengthName > 5) {
alert("More than 5")
}else if (lengthName >= 5) {
alert("Exat 5 letters")
}else {
alert("Less than 5 letters")
}
//output:- Exat 5 letters

Robin_biju
Автор

here are answer by me of the task

1.answer

//task no 1/*
//Question
/*
what will be the output of the following code


let num = 10 + 2;
if(num>2 && num<20){
console.log("true")
}

else{
console.log(false)
}

*/

//Answer TODO:

/* so here both the conditio are true so
it will log "true" on the console */





2.answer
user = prompt("")
/* let user = "employee";
*/ if (user === "guest") {
document.write("login Denied");
} else if (user === "employee") {
document.write("Successfully Logged in");
}

Krenil.