This file contains hidden or 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
/* | |
If a prime is still prime when you reverse the digits | |
and it is a different prime, then it is an emirp. | |
https://en.wikipedia.org/wiki/Emirp | |
The sequence begins with 13 and 2,3,5,7,11 | |
should not return as emirp because they are palindromes. | |
*/ | |
function isNotNum(num) { | |
return /[^0-9]/.test(String(num)); |
This file contains hidden or 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
// if a number is divisible by a number the remainder is zero | |
for (i = 1; i <= 100; i++) { | |
if (i % 3 === 0 && i % 5 === 0) { | |
console.log("CracklePop"); | |
} else if (i % 3 === 0) { | |
console.log("Crackle"); | |
} else if (i % 5 === 0) { | |
console.log("Pop"); | |
} else { |