while there are many explanations, easiest to understand was yours. the only part I struggle to understand is this one "isPalindrome(product) && product > largestPalindrome", can you please explain what it means?
We first check if the product is a palindrome. Because if it isn't, we don't care about it.
Then, we check if it is greater than our existing largest palindrome because our goal is to find the largest palindrome.
If both those conditions are true, the product being a palindrome and it being larger than our existing largest palindrome, we set that as our largest palindrome.
Hope that helps, let me know if you still have questions!
Just did this super quick in JS.
while there are many explanations, easiest to understand was yours. the only part I struggle to understand is this one "isPalindrome(product) && product > largestPalindrome", can you please explain what it means?
Yes. Let's try reading it step by step:
Hope that helps, let me know if you still have questions!
Thank you, Faraz, I didn't know it was possible to use several conditional operators in one single line of code