Why functions are not working in js | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Why functions are not working in js

My functions are not working in Java script

7th Sep 2020, 6:41 AM
Harsh Mathur (Exams soon )
15 Answers
+ 2
Share your code!
7th Sep 2020, 6:59 AM
Vadivelan
+ 2
You never called the function I guess =>pubg()
7th Sep 2020, 7:06 AM
Abhay
Abhay - avatar
+ 1
Harsh Mathur go through js course for functions again ,use Google to learn from tutorials available on net about how functions work ✌️
7th Sep 2020, 7:45 AM
Abhay
Abhay - avatar
+ 1
What do you want the output? What's a&b??
8th Sep 2020, 3:35 PM
SARA ZAFAR
0
You can't do like this function price = a - b () {return a-b } It should be rather function price(){ return a-b }
7th Sep 2020, 7:39 AM
Abhay
Abhay - avatar
- 1
} function pubg () {alert ("calling a function"); } Vadivelan
7th Sep 2020, 7:00 AM
Harsh Mathur (Exams soon )
- 1
This is function part Its my code in which i practise so no Main code
7th Sep 2020, 7:00 AM
Harsh Mathur (Exams soon )
- 1
Abhay yea i didnt done that then i forgot about it
7th Sep 2020, 7:08 AM
Harsh Mathur (Exams soon )
- 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 }
7th Sep 2020, 7:16 AM
Harsh Mathur (Exams soon )
- 1
This is the code
7th Sep 2020, 7:16 AM
Harsh Mathur (Exams soon )
- 1
Same problem happening in this main code also
7th Sep 2020, 7:16 AM
Harsh Mathur (Exams soon )
- 1
Whats the value of a, b? Save your code and share the code as link!
7th Sep 2020, 7:28 AM
Vadivelan
7th Sep 2020, 7:36 AM
Harsh Mathur (Exams soon )
7th Sep 2020, 7:36 AM
Harsh Mathur (Exams soon )
- 1
Abhay it fixes the error but I dont get any result
7th Sep 2020, 7:42 AM
Harsh Mathur (Exams soon )