js if the reverse of a number is better than the original num

Solutions on MaxInterview for js if the reverse of a number is better than the original num by the best coders in the world

showing results for - "js if the reverse of a number is better than the original num"
Lilly
07 Nov 2018
1//function that takes a two-digit number and determines if it's the largest of two possible digit swaps.
2function largestSwap(num) {
3	return num / 10 > num % 10
4}
5
6console.log(largestSwap(14));
7console.log(largestSwap(53));
8console.log(largestSwap(99));
similar questions