17 Pro JavaScript tricks you didn't know
This thought-provoking post by Rahul will increase your efficiency and productivity when coding JavaScript. - http://amp.gs/Mlp9
#javascript
This thought-provoking post by Rahul will increase your efficiency and productivity when coding JavaScript. - http://amp.gs/Mlp9
#javascript
DEV Community
17 Pro JavaScript tricks you didn't know
There are many ways to write code but generally the first way for many people is very long and can ta...
Write a JavaScript program to find the larger number from the two given positive integers, the two numbers are in the range 40..60 inclusive.
function max_townums_range(x, y){
if( (x >= 40) && (x <= 60) && (y >= 40 && y <= 60) ){
if(x === y){
return "Numbers are the same";
}else if (x > y){
return x;
}else{
return y;
}
}else{
return "Numbers don't fit in range";
}
}
console.log(max_townums_range(45, 60));
console.log(max_townums_range(25, 60));
console.log(max_townums_range(45, 80));
function max_townums_range(x, y){
if( (x >= 40) && (x <= 60) && (y >= 40 && y <= 60) ){
if(x === y){
return "Numbers are the same";
}else if (x > y){
return x;
}else{
return y;
}
}else{
return "Numbers don't fit in range";
}
}
console.log(max_townums_range(45, 60));
console.log(max_townums_range(25, 60));
console.log(max_townums_range(45, 80));
Follow Us On Twitter For Amazing Tweets Related To Programming & Web Development π₯π₯π₯
Follow Now ππ
https://twitter.com/CodingMaster6?s=09
Follow Now ππ
https://twitter.com/CodingMaster6?s=09