-
-
Save mmloveaa/f281fa1e5f478927f956cca8e28fba08 to your computer and use it in GitHub Desktop.
Q1-3
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
var x = 100; | |
function test() { | |
if(false) { | |
var x = 199; | |
} | |
console.log(x); | |
} | |
test(); | |
// What is the value of x after the following code executes? | |
var chars = ["1", "2", "3"]; | |
var x = chars.reduce(function(a, b){ | |
return a + b; | |
}); | |
console.log(x) | |
console.log(typeof(x)) | |
// function test() { | |
// if("peanut butter" && "jelly"){ | |
// return 1+3; | |
// }else { | |
// return false | |
// } | |
// } | |
// test(); | |
function test() { | |
if("2" == 2){ | |
return 5+6; | |
}else { | |
return false | |
} | |
} | |
test(); | |
// function test() { | |
// if("yes" || true){ | |
// return 3+3; | |
// } else { | |
// return false | |
// } | |
// } | |
// test(); | |
// function test() { | |
// if(NaN !== NaN){ | |
// return 1+1; | |
// } else { | |
// return false | |
// } | |
// } | |
// test(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment