Last active
September 4, 2019 16:16
-
-
Save rintoandrews90/8bc8978f4324b03275189499415ccf07 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******* | |
* If / else statments | |
* */ | |
var firstName = 'john'; | |
var civilStatus = 'single'; | |
if (civilStatus === 'single') { | |
console.log('single'); | |
} else { | |
console.log('married'); | |
} | |
//Bool in if condition | |
var isMarried = true; | |
if (isMarried) { | |
console.log('single'); | |
} else { | |
console.log('married'); | |
} | |
var job = 'teacher'; | |
switch (job) { | |
case 'teacher': | |
console.log('teach students'); | |
break; | |
case 'driver': | |
console.log('drive car'); | |
break; | |
default: | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment