+ 3
Javascript help!
Write js function by name test Theat subtracts B value from A and then stores the results in C and uses them as output .
12 Réponses
+ 4
Something like this:
https://code.sololearn.com/WqZhvnlA5IzH/?ref=app
+ 6
qwerty are we practicing patience ☑
+ 5
Have you tried it yourself? Show us your attempt and tell us what your problem is.
+ 5
Omar Khalil Bakhsh Here is another way.
function test (A,B) {
var c =B-A;
return c;
}
document.write(test(4,6));
//Output 2
+ 5
qwerty OK! I understand it.
+ 5
function test (A,B) {
var c =A-B;
return c;
}
document.write(test(6,4));
//Output 2
+ 4
qwerty
function test (A,B)
{
var c =B-A;
return c;
document.write(c);
}
he say it is wrong 😓
+ 4
Subtract B from A means A-B, not B-A.
Also remove return c;
+ 4
Warith Vatanaplachaigoon Subtract B from A means A-B. Subtract A from B means B-A.
+ 3
qwerty yes i did
+ 3
thanks i will practise more +
+ 2
Show us your attempt