You can use the following JavaScript code to add a browser t…

You can use the following JavaScript code to add a browser test for the find() method that will execute the if branch to locate an element in the invoices array if this method is supported by the user’s web browser, but move on to the else branch if the method is not supported: if (invoices.find) {    let firstOverdue = invoices.find(overdue); } else { //alternate code in place of the find() method

The following JavaScript code will display the message “You…

The following JavaScript code will display the message “You can vote!” if the age variable’s value is 40, but will display “When you are 18, you can vote!” if the age variable’s value is 4. if (age >= 18) { window.alert(“You can vote!”); } else { window.alert(“When you are 18, you can vote!”); } ​