Last active
May 21, 2020 19:13
-
-
Save tiagoamaro/c472cb59144721b543732d7e72a7c25e to your computer and use it in GitHub Desktop.
Lógica de Programação 2020 - Aula 04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cakeIsBaked = false | |
let totalMinutes = 0 | |
let minutesToBake = 30 | |
while (!cakeIsBaked) { | |
totalMinutes = totalMinutes + 10 // Wait 10 minutes | |
if (totalMinutes === minutesToBake) { | |
cakeIsBaked = true // Exit condition | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let basket = ["apple", "banana", "orange"] | |
for (let fruit of basket) { | |
console.log(fruit) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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