Return Statements in JavaScript and Automatic Semicolon Insertion

Christopher Jeffery
Level Up Coding
Published in
2 min readMay 4, 2020

--

All developers writing JavaScript should understand automatic semicolon insertion as it relates to return statements.

Photo by Joshua Aragon on Unsplash

JS uses automatic semicolon insertion. This means JS engines will execute code and insert any semicolons where it sees fit.

One of those spots is after a return statement.

--

--