Open
Description
An object is in "such state" functions:
- Come in the form of questions we can answer yes or no to. Like is the integer prime?, is the string a palindrome?, etc.
function isPrime(num) {
for ( var i = 2; i < num; i++ ) {
if ( num % i === 0 ) {
return false;
}
}
return true;
}
function isPalindrome(str) {
var strR =str.split("").reverse().join("");
return strR === str;
}
Metadata
Metadata
Assignees
Labels
No labels