re: Project Euler #4 - Largest Palindrome Product VIEW POST

TOP OF THREAD FULL DISCUSSION
re: My typescript solution: function reverseInteger(n: number): number { return Number(String(n).split('').reverse().join('')); } function isPali...
 
if (condition) {
  return true;
}
return false;

Please don't do this 😕 It's verbose for no reason. You can accomplish the same with just return condition;.

 

cool! yes so much simple

function isPalindrome(num: number): boolean {
  return num === reverseInteger(num);
}

thanks!

code of conduct - report abuse