Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save luanpotter/e07595322bf1771a22ff764d0b9f0bd5 to your computer and use it in GitHub Desktop.
Save luanpotter/e07595322bf1771a22ff764d0b9f0bd5 to your computer and use it in GitHub Desktop.
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