0
JavaScript
window.onload = function() { var x = document.getElementById("demo"); x.style.color = '#6600FF'; x.style.width = '100px'; }; Anyone can explain what is the point of ; at the end of the fucntion ( ie. }; )
4 odpowiedzi
+ 1
is it mandatory in this case? because i deleted it and nothing changed
+ 1
These may give a bit of insight about semicolon in Javascript
https://medium.com/better-programming/you-might-need-those-semicolons-in-your-javascript-after-all-b28154f93ea8
https://stackoverflow.com/questions/444080/do-you-recommend-using-semicolons-after-every-statement-in-javascript
0
Termination of line
0
sara edwart no it's not mandatory to use semicolon, you can run js codes without semicolon