1console.log("The future says:", future());
2
3function future() {
4 return "You'll never have flying cars";
5}
1const power = (base, exponent) => {
2 let result = 1;
3 for (let count = 0; count < exponent; count++) {
4 result *= base;
5 }
6 return result;
7};
1const hummus = function(factor) {
2 const ingredient = function(amount, unit, name) {
3 let ingredientAmount = amount * factor;
4 if (ingredientAmount > 1) {
5 unit += "s";
6 }
7 console.log(`${ingredientAmount} ${unit} ${name}`);
8 };
9 ingredient(1, "can", "chickpeas");
10 ingredient(0.25, "cup", "tahini");
11 ingredient(0.25, "cup", "lemon juice");
12 ingredient(1, "clove", "garlic");
13 ingredient(2, "tablespoon", "olive oil");
14 ingredient(0.5, "teaspoon", "cumin");
15};