+ 2

Why does my program crash?

I am completely new away this so I apologize if this is the wrong place or a stupid question. I made a simple calculator for work purposes and it works but if I click calculate with no user input, the screen goes white. if someone could point me in the right direction I would appreciate it! https://code.sololearn.com/Wzot26GUCVot/?ref=app https://code.sololearn.com/Wzot26GUCVot/?ref=app

12th Sep 2018, 2:07 PM
BelowZer0
BelowZer0 - avatar
5 Respostas
+ 5
You see the error is in the line 18. You cant use ** for exponentation in JavaScript. Instead you can use Math.pow(i, j) where i is the base and j the exponent.
12th Sep 2018, 3:34 PM
Ledio Deda
Ledio Deda - avatar
+ 6
Glad to help✌ It doesnt change anything if you code in sololearn in phone or pc
12th Sep 2018, 3:57 PM
Ledio Deda
Ledio Deda - avatar
+ 5
If you put the Calculate button outside the form, it automatically goes to a new line(form is a block element). If you put is inside the form, it doesnt. So you get the side by side result. This happens because button is an inline element. See more about inline and block elements in HTML course. Btw, it took me a lot of time to understand your question😂😂😂
12th Sep 2018, 3:53 PM
Ledio Deda
Ledio Deda - avatar
+ 2
that did fix the crash issue but I also realized it has to do with what is inside my <form> .............</form> it runs fine if my "calculate" button is not included inside of it? and bc of that, the buttons are now on top of one another as opposed to side by side? this may be more complicated than I originally thought lol thank you for your help **Edit** I am also doing all this on my phone at work and it may be an issue between the app and actually using a computer, not sure??
12th Sep 2018, 3:48 PM
BelowZer0
BelowZer0 - avatar
+ 2
lol I apologize! thank you again for the help and i will continue to work with it! THANKS!! 😂😂
12th Sep 2018, 3:56 PM
BelowZer0
BelowZer0 - avatar