

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why does the JavaScript need to start with “;”?
JavaScript uses a semi-colon (;) to avoid any confusion in code, especially the beginning of a new line.
Example
You can still use the following to avoid any chaos in the code −
return { 'var':myVal } // using semi-colon; (function( $ ) { // }
- Related Questions & Answers
- Why does Lua have no “continue” statement?
- Why avoid increment (“++”) and decrement (“--”) operators in JavaScript?
- How does the “this” keyword work in JavaScript?
- Why is [1,2] + [3,4] = “1,23,4” in JavaScript?
- Why does the indexing start with zero in C# arrays?
- Why does C++ need the scope resolution operator?
- Why does MySQL evaluate “TRUE or TRUE and FALSE” to true?
- How to Replace null with “-” JavaScript
- What does “javascript:void(0)” mean?
- How does the Java “foreach” loop work?
- How does the “Pica” disorder affect kids?
- How to create a dialog with “yes” and “no” options in JavaScript?
- What does the “yield” keyword do in Python?
- Why does one need a mentor in life to grow?
- Does it make sense to use “LIMIT 1” in a query “SELECT 1 …”?
Advertisements