Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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));
Comment

PREVIOUS NEXT
Code Example
Javascript :: nodejs get prosses id 
Javascript :: how to trim the file name when length more than 10 in angular 
Javascript :: cannon js parent child 
Javascript :: javascript delete dict value 
Javascript :: discord.js bot presence 
Javascript :: split array in to equal parts and make 2 array javascript 
Javascript :: js backwards loop 
Javascript :: get difference of minutes between two time based on am, pm 
Javascript :: aframe basic example 
Javascript :: javascript scale values 
Javascript :: write an array that invokes the alter function in to the array 
Javascript :: Axios with React Hooks, “traditional” Promise syntax 
Javascript :: angular two way binding 
Javascript :: chart js react 
Javascript :: client.login(email, password) discord.js 
Javascript :: react native stack transition from right to left 
Javascript :: react-app-rewired test single file 
Javascript :: js confirm 
Javascript :: how to have jsx tellisense vscode 
Javascript :: choco node 17 
Javascript :: react native detect platform 
Javascript :: python run javascript 
Javascript :: react hook form with controlled input 
Javascript :: React Javascript Builtin Hooks Import bug 
Javascript :: how to pass a component as a prop in react 
Javascript :: angular keyframes % 
Javascript :: js deep copy 
Javascript :: html to jsx 
Javascript :: react hooks link to external site 
Javascript :: vue js qr code scanner 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =