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. }; )

28th Dec 2020, 6:57 AM
Sara
Sara - avatar
4 odpowiedzi
+ 1
is it mandatory in this case? because i deleted it and nothing changed
29th Dec 2020, 6:10 AM
Sara
Sara - avatar
0
Termination of line
28th Dec 2020, 7:01 AM
ABHISHEK
ABHISHEK - avatar
0
sara edwart no it's not mandatory to use semicolon, you can run js codes without semicolon
29th Dec 2020, 7:23 AM
ABHISHEK
ABHISHEK - avatar