+ 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
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.
+ 6
Glad to help✌
It doesnt change anything if you code in sololearn in phone or pc
+ 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😂😂😂
+ 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??
+ 2
lol I apologize! thank you again for the help and i will continue to work with it! THANKS!! 😂😂