What is the difference between == and ===? Why is it necessary to have both of these?
Rewrite the following code using the ternary operator:
var isColdOutside = true;
var clothingToWear;
if (isColdOutside) {
clothingToWear = 'sweater and a jacket';
} else {
clothingToWear = 'shorts and a t-shirt';
}Rewrite the following using a for loop:
var i = 0;
while (i <= 10) {
console.log(i);
i++;
}To skip to the next iteration of a loop you would use which statement?
break;continue;
Rewrite the following using a switch statement:
// assume getWeatherConditions will return one of 'rain', 'snow', 'clear'
var conditions = getWeatherConditions();
if (conditions == 'rain') {
console.log('bring an umbrella!');
} else if (conditions == 'snow') {
console.log('What!? In San Antonio?');
} else if (conditions == 'clear') {
console.log('It\'s a nice day!');
}What is the difference between inline and external JavaScript? Why would you use one over the other?
What does the following code output?
console.log(10 % 3);33.333333301
Do the following evaluate to true or false?
"" == false0 === false"42" != 42- `"42" !== 42``
The following expressions are shorthand, write out the longhand version.
i++x -= 5x /= 3myString += ', and thanks for all the fish';