- 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 6685 Articles for Javascript
![radhakrishna](https://www.tutorialspoint.com/assets/profiles/13544/profile/60_40618-1512640354.jpg)
472 Views
/*…*/ and /**…*/ are multi-line comments. The following is a multi line comment in JavaScript./* * This is a multiline comment in JavaScript * It is very similar to comments in C Programming */The following example shows how to use multi-line comments in JavaScript. The comment /** */ is for PHPDocumentator , which is used to make automatic documentation.
![mkotla](https://www.tutorialspoint.com/assets/profiles/13540/profile/60_41073-1512640012.jpg)
4K+ Views
To add line breaks to JavaScript alert, use “\r”. In the following example, we will see how to display text in JavaScript alert.Example Live Demo function DisplayAlert() { var newLine = "\r" var msg = "Showing how to add line break." msg += newLine; msg += "Line Break can be easily added in JavaScript."; msg += newLine; msg += "Simply Easy Learning"; msg+= newLine; msg += "TutorialsPoint.com"; alert(msg); }
![Sreemaha](https://www.tutorialspoint.com/assets/profiles/13570/profile/60_64977-1512709068.jpg)
2K+ Views
The following are the differences between JavaScript and C++.JavaScript is a lightweight, interpreted programming language. It is designed for creating network-centric applications. It is complementary to and integrated with Java. JavaScript is very easy to implement because it is integrated with HTML. It is open and cross-platform.C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. It runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.JavaScript is a scripting whereas C++ is a programming language.C++ program is to be compiled and executed, whereas a script in ... Read More
![varma](https://www.tutorialspoint.com/assets/profiles/13568/profile/60_26300-1512638592.jpg)
472 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 */
![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)
227 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