js calculate
answer_Add = 5 + 1; //answer = 6
answer_Sub = 5 - 1; //answer = 4
answer_Multi = 5 * 5; //answer = 25
answer_Divi = 10 / 2; //answer = 5
Total = answer_Add + answer_Sub + answer_Multi + answer_Divi;
js calculate
answer_Add = 5 + 1; //answer = 6
answer_Sub = 5 - 1; //answer = 4
answer_Multi = 5 * 5; //answer = 25
answer_Divi = 10 / 2; //answer = 5
Total = answer_Add + answer_Sub + answer_Multi + answer_Divi;
how to implement add(3).mul(5).divide(3) javascript
<!DOCTYPE html>
<html>
<body>
<p>Result is.</p>
<p id="demo">0</p>
<script>
document.getElementById("demo").innerHTML = add(3).mul(5).divide(5);
function add(num) {
return {
mul: function(mulNum) {
let mulResult = num * mulNum
return {
divide: function(divNum) {
let divResult = mulResult/divNum;
return divResult
}
}
}
}
}
</script>
</body>
</html>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us