Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js check which number is larger

//Which number is larger
function whichIsLarger(num1 , num2){
	return num1 > num2 ? 'num1': num1 < num2 ? 'num2' : 'neither';
}

console.log(whichIsLarger(10, 8)); //num1
console.log(whichIsLarger(11, 11));//neither
console.log(whichIsLarger(-1, 5)); //num2
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript create array of objects with map 
Javascript :: opencv4nodejs mac install 
Javascript :: react media query hook 
Javascript :: display am pm in javascript 
Javascript :: how to write img jsx 
Javascript :: javascript array remove empty strings 
Javascript :: play music from file js 
Javascript :: localstorage save array 
Javascript :: json schema string or null 
Javascript :: filter falsy values 
Javascript :: money separator in javascript 
Javascript :: how to create a button with react 
Javascript :: VM724:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 
Javascript :: javascript sort object by key 
Javascript :: loopback upsert with where 
Javascript :: express search query template 
Javascript :: for each element in object 
Javascript :: javascript open new window 
Javascript :: jquery remove disabled property from button 
Javascript :: Uncaught Error: Incompatibile SockJS! Main site uses: "1.0.2", the iframe: "1.0.0". 
Javascript :: find all images without alternate text 
Javascript :: seleccionar value select2 js 
Javascript :: eslint ignore file rule 
Javascript :: Using webpack 5. Reason: future.webpack5 option enabled https://nextjs.org/docs/messages/webpack5 
Javascript :: subtract two date javascript 
Javascript :: ajax load spesific element from another page 
Javascript :: jest-environment-jsdom cannot be found 
Javascript :: detect two strings are anagram of each other in JavaScript 
Javascript :: jquery change text color 
Javascript :: how to capitalize a letter based on an index in javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =