Yatit Thakker
1 min readAug 19, 2018

I appreciate your writing a well-thought criticism and contributing to making the article better rather than writing a meaningless troll comment. Here’s the counter-example that I should have included in the article.

const es6Function = (variable) => {
// function logic goes here
}

The above is a function declaration, variable declaration, and a variable assignment at the same time. According to ES5 rules, since it’s a variable declaration first, it should include a semi-colon at the end. However, declaring a function this way is such common practice in ES6 code that removing the semi-colon from the end of this function is better for readability to let developers know that it’s a function and not a variable declaration.

Edit: Added examples to the article for clarity.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Yatit Thakker
Yatit Thakker

Written by Yatit Thakker

Renaissance Engineer. Entrepreneur. Passionate about technology, education, and the environment.

Responses (1)

Write a response