Write a JavaScript program to compute the absolute difference between a specified number and 19. Returns triple their absolute difference if the specified number is greater than 19.
function diff_num(n) {
if (n <= 19) {
return (19 - n);
}
else
{
return (n - 19) * 3;
}
}
console.log(diff_num(12));
console.log(diff_num(19));
console.log(diff_num(22));
function diff_num(n) {
if (n <= 19) {
return (19 - n);
}
else
{
return (n - 19) * 3;
}
}
console.log(diff_num(12));
console.log(diff_num(19));
console.log(diff_num(22));
I've completed 70K Followers on my Instagram page @coding_.master π₯³π₯³ππππ₯π₯
Thnxx to all guys from the bottom of my heart β€β€β€π₯°π₯°π€π€
Keep supporting always ππ
Follow us on Instagram to learn web development ππ https://www.instagram.com/coding_.master/
Thnxx to all guys from the bottom of my heart β€β€β€π₯°π₯°π€π€
Keep supporting always ππ
Follow us on Instagram to learn web development ππ https://www.instagram.com/coding_.master/
8 JavaScript & CSS Frameworks for Enhancing HTML Forms ππ