If/else statements


#1

Hi, i have ust completely forgot how to make if/else statements.... i need YOUR help :slight_smile:

https://www.codecademy.com/courses/getting-started-v2/4/5?curriculum_id=506324b3a7dffd00020bf661#

no errors, i just need your help :slight_smile:


#2

Hi can you post your code?


#3

i dont have a code... as i said, i only need help with how to write an if ellse statement.


#4

you do it like that

if (condition) {
    #Do something
}
else {
    #Do something
}

#5

if ("school") {
console.log("True")
}
else {
console.log("False")
}

am i stupid or something? xDDD


#6

https://gyazo.com/d0c4385cf80bfc31511fc74a57700f23


#7

this line

if ("school")

a string can't be a condition a conbdition could be

if (2 < 6)

depend on what they aske you ro do and your


#8

https://gyazo.com/68fc0f71e42c0f2e3b9c62b558e73be9


#9

the intrution says..
02. The only instruction is that the result of evaluating the statement is a log to the console of "I finished my first course!".


#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.