Why is automatic insertion with two commas (ASI) added in javascript?

Due to the "religious war" in my current workplace, I decided to research the history of the ASI javascript function.

But it's hard for me to understand why and when ASI was introduced in javascript.

It seems like it was a function forever, but is there a specific reason there are two ways to stop asserting in javascript?

Some sources describe ASI as an error correction function, which implies that lowering half-columns is bad practice.

Is there any impact on the use of ASI?

Personally, I prefer semicolons because it makes intentions more explicit, but personal preferences are not a viable argument in any serious discussion.

+5
source share
1 answer

Great question!

Brenden Eich originally developed the JavaScript programming language, and I think it's fair to say that he agrees that automatically inserting a semicolon is a design error in that language.

We should not blame him. He developed the language in just 10 days in 1995, not suspecting that in 20 years it would become (probably) the most important computer language on the planet.

In the next post, he says: "I am sorry that I did not make new lines more significant in JS in those ten days in May 1995."

https://brendaneich.com/2012/04/the-infernal-semicolon/

Read on ... :)

+4
source

All Articles