The browser storage localStorage is not available. Either your browser does not support it or you have disabled it or the maximum memory size is exceeded. Without localStorage your solutions will not be stored.


If a code block should be executed if an if condition is not fulfilled, an else is added.
var message;
if (amount > 1000) {
  message = 'No payout possible!';
} else {
  message = 'The amount will be paid out!';
Depending on whether amount is greater or smaller 1000, either the if branch or the else branch is executed.


Write a function addWithSurcharge that adds two amounts with surcharge. For each amount less than or equal to 10, the surcharge is 1. For each amount greater than 10, the surcharge is 2. The call addWithSurcharge(5, 15) should return 23.