- What value is now stored in the variable name?
var isKing = true;
var name = isKing ? ‘Arthur’ : ‘Hank’;
-
What is the difference between == and === in Javascript?
-
Write a function that takes two numbers as arguments and returns the sum of the two numbers in Javascript
-
Write a function that takes an array as an argument and prints out the numbers in the array that are greater than 5 (for example foo([3,6,1,7]) would print out 6 and 7) in Javascript
-
Write a for loop that will iterate from 0 to 20. For each iteration, it will check if the current number is even or odd, and report that to the screen in Javascript
-
What does 'this' refer to when used in a JavaScript method?
-
Create an object that has properties with name = "fred" and major="music" and a property that is a function that takes 2 numbers and returns the smallest of the two, or the square of the two if they are equal.
-
What’s the result of executing this code and why?
function test() {
console.log(a);
console.log(foo());
var a = 1;
function foo() {
return 2;
}
}
test();
-
Write a function to print out the song lyrics to "99 Bottles of Beer." Now add a case for when there are no bottles left.
-
Write a function to mimic the game of Exploding Kittens using a standard 52 card deck with a single joker. Deal a random card to each player each turn. The game ends when someone is dealt the joker. Display a dialogue message to the losing player.