Created
July 30, 2020 20:36
-
-
Save luanpotter/e07595322bf1771a22ff764d0b9f0bd5 to your computer and use it in GitHub Desktop.
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
const bools = ['sim', 'não']; | |
const fx = (num) => { | |
const r=Math.sqrt(num); | |
for(let i=0; i<=r; i++) | |
if(num % i === 0) return false; | |
return num>1; | |
}; | |
const compute = () => { | |
const result = fx(Math.pow(13, 7)) ? 0 : 1; | |
return `${bools[result]} é o que parece!`; | |
}; | |
const main = () => { | |
console.log(compute()); | |
}; | |
main(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment