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

0

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

//function that takes a two-digit number and determines if it's the largest of two possible digit swaps.
function largestSwap(num) {
	return num / 10 > num % 10
}

console.log(largestSwap(14));
console.log(largestSwap(53));
console.log(largestSwap(99));
Posted by: Guest on February-26-2021

Code answers related to "js if the reverse of a number is better than the original num"

Code answers related to "Javascript"

Browse Popular Code Answers by Language