Given these two variables
var firstNumber = 34;
var secondNumber = 89;write an if statement that checks whether firstNumber is smaller than secondNumber. If it is, log the message "The first number is smaller than the second".
Given these two variables
var age = 11;
var minimumAge = "13";write code that checks whether age meets the minimumAge requirement. Log a message if it passes the test and use an else block to log a message if it doesn't.
Given these two variables
var income = "11.050";
var maximumIncome = "13.075";write code that checks whether income meets the maximumIncome requirement. Log a message if it passes the test and use an else block to log a message if it doesn't.
Fix this code:
var colour = "blue";
if ((colour = "orange")) {
console.log("This colour is a bit rubbish");
}Given the following variable
var invoicePaid = false;write code that logs the message "Not paid" if the invoice has not been paid.
Given these two variables
var selectedNumber = 11;
var winningNumber = "15";write code that checks if the winning number hasn't been selected. If it hasn't, log the message "You lose again". Use the strict inequality operator.
Given this variable
var dayOfTheWeek = 2;write a switch statement that log the weekday name depending on the value of dayOfTheWeek. If dayOfTheWeek is 1, log "Monday", if it is 2 log "Tuesday".
If the dayOfTheWeek is not a number between 1 and 7, log the message "Invalid day number".