- Trending Categories
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
Found 8895 Articles for Front End Technology
![Prabhas](https://www.tutorialspoint.com/assets/profiles/13554/profile/60_90506-1512543588.jpg)
121 Views
Single Line commentThe following is a single line comment in JavaScript. Any text between a // and the end of a line is treated as a comment and is ignored by JavaScript.// This is a comment. It is similar to comments in C++Multi-Line commentThe following is a multi-line comment in JavaScript./* * This is a multiline comment in JavaScript * It is very similar to comments in C Programming */
![seetha](https://www.tutorialspoint.com/assets/profiles/13549/profile/60_42938-1512640859.jpg)
223 Views
JavaScript basics include an overview of JavaScript. JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow a client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.VariablesLike many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container.Scope of VariablesThe scope of a variable is the region of your program in which it is ... Read More
![radhakrishna](https://www.tutorialspoint.com/assets/profiles/13544/profile/60_40618-1512640354.jpg)
3K+ Views
JavaScript is a case-sensitive language. This means that the language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters.So the identifiers Time and TIME will convey different meanings in JavaScript.NOTE − Care should be taken while writing variable and function names in JavaScript.ExampleThe following example shows JavaScript is a case-sensitive language: My favorite subject var subject, Subject; subject = "Java"; Subject = "Maths"; document.getElementById("demo").innerHTML = subject;
![mkotla](https://www.tutorialspoint.com/assets/profiles/13540/profile/60_41073-1512640012.jpg)
228 Views
A function in JavaScript looks like the following:(function(){...})()A library in JavaScript shows a function, which begins with a semicolon, for example:;(function ) { }The semicolon allows to safely concatenate several JS files into one. This is to serve it faster as one HTTP request.A leading semicolon can also be to protect from preceding code, which may have been improperly closed. A semicolon will definitely prevent this from happening.
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
4K+ Views
In this tutorial, we will learn to convert a float number to a whole number in JavaScript. The whole number is the number that doesn’t contain the fractional part. For example, 5.22 is the float number containing the fractional part, and the whole number doesn’t contain a decimal part. So, our goal in this tutorial is to remove the fractional part from the number.We can have various methods to cut out the decimal part from the float number to make it whole, and some of them we have discussed here.Using the Math.trunc() and Math.round() MethodsUsing the parseInt() MethodUsing the Bitwise ... Read More
![varma](https://www.tutorialspoint.com/assets/profiles/13568/profile/60_26300-1512638592.jpg)
308 Views
In JavaScript, Semicolons are optional. Simple statements in JavaScript are generally followed by a semicolon character, just as they are in C, C++, and Java. JavaScript, however, allows you to omit this semicolon if each of your statements is placed on a separate line. It is a good programming practice to use semicolons.In JavaScript, use a semi-colon after a statement. Let’s see an example of a variable assignment:var s = function() { alert("Hello World!"); };However, semicolons aren’t necessary for the following function declarations:function() { alert("Hello World!"); };
![varun](https://www.tutorialspoint.com/assets/profiles/13559/profile/60_29674-1512637943.jpg)
125 Views
In JavaScript, Semicolons are optional. Simple statements in JavaScript are generally followed by a semicolon character, just as they are in C, C++, and Java. JavaScript, however, allows you to omit this semicolon if each of your statements is placed on a separate line. It is a good programming practice to use semicolons.For example, the following code could be written without semicolon. But when formatted in a single line as follows, you must use semicolons −
![usharani](https://www.tutorialspoint.com/assets/profiles/13564/profile/60_32161-1512638316.jpg)
1K+ Views
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: Line-break in an alert box. Click below button. Click
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
4K+ Views
This tutorial teaches us to replace newlines with spaces in JavaScript. Often, programmers find unusual line breaks in the string, and the random line breaks look weird when we render them on the webpage using JavaScript.So, the solution is that programmers just need to remove the line breaks and join the string with the space or other characters. Here, we have different approaches to solving this problem, and we will use the regular expression with the replace() method to remove the unusual line breaks.Using the replace() MethodUsing the split() and join() MethodsUsing the replace() MethodIn this approach, we will use ... Read More
![seetha](https://www.tutorialspoint.com/assets/profiles/13549/profile/60_42938-1512640859.jpg)
6K+ Views
Method and a function are the same, with different terms. A method is a procedure or function in object-oriented programming.A function is a group of reusable code which can be called anywhere in your program. This eliminates the need for writing the same code again and again. It helps programmers in writing modular codes.The following is the syntax of a JavaScript function: Here’s an example: