Created
March 6, 2019 00:23
-
-
Save NimaBoscarino/497aa1ca17779baa1151e880ba8ef3ef 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
// Question 1 | |
// Nothing happens | |
// Question 2 | |
let bestFriend = 'Tyson' | |
console.log(bestFriend) // Tyson | |
// Question 3 | |
// Hypothesis: undefined, Tyson | |
// Hypothesis: Tyson, Tyson <-- Correct! | |
// Hypothesis: Tyson, undefined | |
let bestFriend = 'Tyson' | |
function sayBestFriend() { | |
console.log(bestFriend) | |
} | |
console.log(bestFriend) | |
sayBestFriend() | |
// Question 4 | |
// Hypothesis: Tyson, Hussain | |
let bestFriend = 'Tyson' | |
function sayBestFriend() { | |
bestFriend = 'Hussain' | |
console.log(bestFriend) | |
} | |
console.log(bestFriend) | |
sayBestFriend() | |
// Question 5 | |
// Hypothesis: Hussain, Tyson | |
// Hypothesis: Hussain, Hussain | |
let bestFriend = 'Tyson' | |
function sayBestFriend() { | |
bestFriend = 'Hussain' | |
console.log(bestFriend) | |
} | |
sayBestFriend() | |
console.log(bestFriend) | |
// Question 6 | |
// Hypothesis: Tyson, Hussain, Tyson | |
let bestFriend = 'Tyson' | |
function sayBestFriend() { | |
let bestFriend = 'Hussain' | |
console.log(bestFriend) | |
} | |
console.log(bestFriend) | |
sayBestFriend() | |
console.log(bestFriend) | |
sayBestFriend() | |
// Question 7 - Surprise! | |
let bestFriend = 'Tyson' | |
function sayBestFriend() { | |
let bestFriend = 'Hussain' | |
console.log(bestFriend) | |
sayBestFood() | |
} | |
function sayBestFood() { | |
let bestFood = 'potato' | |
console.log(bestFood) | |
} | |
console.log(bestFriend) | |
sayBestFriend() | |
console.log(bestFood) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment