- 1
Why functions are not working in js
My functions are not working in Java script
15 odpowiedzi
+ 2
Share your code!
+ 2
You never called the function I guess
=>pubg()
+ 1
Harsh Mathur go through js course for functions again ,use Google to learn from tutorials available on net about how functions work ✌️
+ 1
What do you want the output? What's a&b??
0
You can't do like this
function price = a - b () {return a-b
}
It should be rather
function price(){
return a-b
}
- 1
}
function pubg () {alert ("calling a function");
} Vadivelan
- 1
This is function part Its my code in which i practise so no Main code
- 1
Abhay yea i didnt done that then i forgot about it
- 1
Vadivelan var price = 40 - 19
if (price == 10) {document.write("<h1> You are right</h1>");
}
else if (price != 10){document.write("<h4> You are wrong</h4>");
}
function price a - b {return
a - b
}
- 1
This is the code
- 1
Same problem happening in this main code also
- 1
Whats the value of a, b?
Save your code and share the code as link!
- 1
- 1
Abhay it fixes the error but I dont get any result