![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What Are Whitespace and Line Breaks in JavaScript?
JavaScript ignores spaces, tabs, and newlines that appear in JavaScript programs. You can use spaces, tabs, and newlines freely in your program and you are free to format and indent your programs in a neat and consistent way that makes the code easy to read and understand.
JavaScript ignores whitespaces. For example, the following are same:
var employee = "Amit"; var employee="Amit";
Line breaks in JavaScript:
<!DOCTYPE html> <html> <body> <p>Line-break in an alert box. Click below button.</p> <button onclick="alert('Hi
Welcome to Tutorialspoint')">Click</button> </body> </html>
Advertisements