Skip to content
Advertisement

Method Returning False but expected true [closed]

The below code is for reversing a 3 digit number and then checking while they are equal. Main method

JavaScript

Method for reversing number

JavaScript

I have given a print statement right after the while loop ends and that print gives correct expected value but the if statement gives false even when it has to be true.

Advertisement

Answer

JavaScript

Because you modified your input param number in number /= 10

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement