Skip to content

Instantly share code, notes, and snippets.

@tiagoamaro
Last active May 21, 2020 19:13
Show Gist options
  • Save tiagoamaro/c472cb59144721b543732d7e72a7c25e to your computer and use it in GitHub Desktop.
Save tiagoamaro/c472cb59144721b543732d7e72a7c25e to your computer and use it in GitHub Desktop.
Lógica de Programação 2020 - Aula 04
let cakeIsBaked = false
let totalMinutes = 0
let minutesToBake = 30
while (!cakeIsBaked) {
totalMinutes = totalMinutes + 10 // Wait 10 minutes
if (totalMinutes === minutesToBake) {
cakeIsBaked = true // Exit condition
}
}
let basket = ["apple", "banana", "orange"]
for (let fruit of basket) {
console.log(fruit)
}
let factorialSum = 1
let factorialNumber = 4
for (let index = 0; index < factorialNumber; index++) {
factorialSum = factorialSum * (factorialNumber - index)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment