---
title: "Use of semicolon in JavaScript"  
description: "Use of semicolon in JavaScript"  
author: "Anonymous User"  
published: 2021-07-19  
updated: 2021-07-19  
canonical: https://www.mindstick.com/forum/156508/use-of-semicolon-in-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# Use of semicolon in JavaScript

Why it is not necessary to use semicolon after every [JavaScript](https://www.mindstick.com/articles/874/how-to-create-watermark-text-for-textbox-by-using-javascript) [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii)? Do you recommend using semicolons after every statement in JavaScript?

## Replies

### Reply by Ethan Karla

It is necessary to use a semicolon to end each statement of JavaScript code and to continue writing the second statement, but if that would be the last statement then JavaScript would work normally without the semicolon. But, remember that it is good habit for developers to code with rules.\
So Yes, you should use semicolons after every statement in JavaScript.


---

Original Source: https://www.mindstick.com/forum/156508/use-of-semicolon-in-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
