+ 2
How do I make this js run in html
//trying hands on Math in js [plus and minus] plus = (a,b) => ( a + b) console.log(plus (1,2)) // ans is 3 console.log (plus(120,200)) // ans is 320 minus = (a,b) => (a - b) console.log (minus (20,15)) //ans is 5 document.write(minus (500,300)) //ans is 200
2 Answers
+ 5
By putting this JS inside of <script></script> tag in head or body.
Although if you're using this Sololearn app, you can directly put JavaScript on JavaScript tab in web code playground.
+ 3
Yes