Question about javascript

why do we enter a semicolon at the end of each line of javascript? it doesn’t seem to make any difference.

it to identify the end of statment
i agree that sometime browser do not mind but you can not relay on that as browser fix some of the missing close tag

hope that help and have a nice day

You probably should not worry about it as JavaScript engines use ASI, Automatic Semicolon Insertion, so your code is always “corrected” anyway — and sometimes in a way you didn’t intend even if you placed a semicolon.
I think anyone should better know how ASI works to don’t get suprises with code not doing what it looks to do and then never put any semicolon (except when necessary) as it is almost always useless if your code is clean.

thanks for sharing that @FlorianMonfort and have a nice day