moved some files around

This commit is contained in:
Geir Okkenhaug Jerstad 2024-08-19 14:41:28 +02:00
parent c8446d5c93
commit 7ee0c5f323
6 changed files with 29 additions and 25 deletions

View file

@ -1,3 +1,21 @@
const square = function(x) {
const square = function (x) {
return x * x;
}
}
const hummus = function (factor) {
const ingredient = function (amount, unit, name) {
let ingredientAmount = amount * factor;
if (ingredientAmount > 1) {
unit += "s";
}
console.log(`${ingredientAmount} ${unit} ${name}`);
};
ingredient(1, "can", "chickpeas");
ingredient(0.25, "cup", "tahini");
ingredient(0.25, "cup", "lemon juice");
ingredient(1, "clove", "garlic");
ingredient(2, "tablespoon", "olive oil");
ingredient(0.5, "teaspoon", "cumin");
};
hummus(10);

View file

@ -13,9 +13,6 @@
function start(){
triangle += "#"
document.getElementById('triangle').innerHTML += `<ul>${triangle}</ul>`
if (document.getElementById('triangle').innerHTML.length() == 5) {
console.log('Nice');
}
}
</script>
</body>