DEV Community

Discussion on: Project Euler #4 - Largest Palindrome Product

Collapse
 
maxart2501 profile image
Massimo Artizzu
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;.

Collapse
 
flrnd profile image
Florian Rand

cool! yes so much simple

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

thanks!