- 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 8894 Articles for Front End Technology
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
336 Views
What is a function in JavaScript? The JavaScript equivalent of a process is a function. A process is a series of instructions for carrying out a task or calculating a value. However, a process must accept input and produce a result to be considered a function. Additionally, there should be a clear connection between the input and the output. Follow the syntax below to define a function This tutorial will guide you to learn the way to execute a JavaScript function using its name in a variable. Syntax function functionName( param1, param2, param3 ) { //code } ... Read More
![Smita Kapse](https://www.tutorialspoint.com/assets/profiles/13597/profile/60_103706-1512718957.jpg)
4K+ Views
JavaScript Identifiers are names given to variables, functions, etc. It is the same as identifiers in other programming languages like C, C++, Java, etc. Let’s see identifiers for variable names.The following are legal variable names −val val1 resultWhile naming your variables in JavaScript, keep the following rules in mind.You should not use any of the JavaScript reserved keywords as a variable name. These keywords are mentioned in the next section. For example, break or boolean variable names are not valid.JavaScript variable names should not start with a numeral (0-9). They must begin with a letter or an underscore character. For ... Read More
![Ankitha Reddy](https://www.tutorialspoint.com/assets/profiles/13550/profile/60_73963-1512711511.jpg)
218 Views
If you want another code while working in the same code document, then use comments. Comment the previous code and add the alternative code to test it. After the testing completes, uncomment the previous code. In this way, you can test both the codes. While using comments follow the below rules to create valid comments − Any text between a // and the end of a line is treated as a comment and is ignored by JavaScript. Any text between the characters /* and */ is treated as a comment. This may span multiple lines. JavaScript also recognizes the ... Read More
![Nitya Raut](https://www.tutorialspoint.com/assets/profiles/13573/profile/60_92249-1512715559.jpg)
567 Views
Try to keep the length of lines less than 80 characters. This would make the code easier to read. Best practice is to move to next line using break if JavaScript statements aren’t fitting in a single line.In addition, move to next line only after a comma or operator. For example, you can add statement like this, with a break after operator,function display() { var a = ""; a = a + isNaN(6234) + ": 6234"; a = a + isNaN(-52.1) + ": -52.1"; a = a + isNaN('') + ": ''"; document.getElementById("test").innerHTML = a; }
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
1K+ Views
In this tutorial, we will learn how to name JavaScript Identifiers. Identifiers in JavaScript are the names we give to variables, arrays, objects, functions, etc We must give the names unique to identify them properly. There are some rules we must follow to name the identifiers that are common to most languages. Rules for naming Identifiers There are certain rules we have to follow before naming an identifier. A proper name helps the programmer to make the code more effective. The rules are the following − JavaScript identifier names should not start with any numeric values like 0-9. For ... Read More
![Jennifer Nicholas](https://www.tutorialspoint.com/assets/profiles/13569/profile/60_88876-1512715262.jpg)
116 Views
The following are some of the common HTML events supported by JavaScript −AttributeValueDescriptiononclickscriptTriggers on a mouse clickoncontextmenuscriptTriggers when a context menu is triggeredondblclickscriptTriggers on a mouse double-clickondragscriptTriggers when an element is draggedondragendscriptTriggers at the end of a drag operationondragenterscriptTriggers when an element has been dragged to a valid drop targetondragleavescriptTriggers when an element is being dragged over a valid drop targetondragoverscriptTriggers at the start of a drag operationondragstartscriptTriggers at the start of a drag operationondropscriptTriggers when dragged element is being droppedondurationchangescriptTriggers when the length of the media is changed
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
31K+ Views
In this tutorial, we will learn how to pass an object as a parameter in a JavaScript function. One of JavaScript's data types is represented by the Object type. It is used to store keyed collections as well as more complex entities. The Object() function Object()or the object initializer / literal syntax can be used to create objects. Almost all JavaScript objects are instances of Object; a typical object inherits properties (including methods) from Object.prototype, though these properties may be shadowed (a.k.a. overridden). Following are the methods used to pass an object as a parameter in a JavaScript function. Using the ... Read More
![Sravani Alamanda](https://www.tutorialspoint.com/assets/profiles/507714/profile/60_44900-1661507911.jpg)
146 Views
In our code, usually, we will get an issue with errors. Errors will disturb the normal flow of our application. So, it is required to handle error exceptions in our code to implement any application in any programming language. Now, we will see how to handle exceptions in Clojurescript. Before that, first we learn what Clojurescript is. What is ClojureScript? At the fundamental level, Closurescript is an accent of the closure programming language that is used to compile to JavaScript. Actually, closure originally compiled only to Java virtual machine bytecode, later in 2011 Closurescript came as an option to ... Read More
![Rishi Rathor](https://www.tutorialspoint.com/assets/profiles/13563/profile/60_89283-1512714754.jpg)
650 Views
To catch all JavaScript unhandled exceptions, use window.error. The onerror event handler provides three pieces of information to identify the exact nature of the error −Error message − The same message that the browser would display for the given errorURL − The file in which the error occurredLine number− The line number in the given URL that caused the errorExampleYou can try to run the following code to catch unhandled exceptions − Click the following to see the result: