Took 1 minutes and 30 seconds to code JavaScript abs() method. Here is the code snippet.
Code:
function abs(num) {
num2 = num * -1;
return num2;
}
document.write(abs(-4.7));
Result:
4.7
Coding & Robotics for Kids | 10xCoderKids is your partner in the journey to become 10x Coder !!!
What is coding? In coding we build a program to do a specific task for us. Code: A code is a set of computer instructions and when you will ...
No comments:
Post a Comment