
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What is the syntax for leading bang! in JavaScript function?
To execute an anonymous function you need to use the leading bang! or any other symbol −
!function(){ // do stuff }();
You can also write it like −
+function(){ // do stuff }();
Even the following is an acceptable syntax −
~function(){ // do stuff return 0; }( );
- Related Articles
- What is the Kotlin double-bang (!!) operator?
- What is the syntax to define enums in javascript?
- What is the syntax for boolean values in MongoDB?
- What is the syntax for lambda expressions in Java?
- What is the correct syntax for NOT LIKE in MySQL?
- What are syntax errors in JavaScript?
- What is the syntax for defining the data structure in C++?
- What does the leading semicolon in JavaScript libraries do?
- Strange syntax, what does `?.` mean in JavaScript?
- What is basic syntax of Python for Loops?
- Explain the arrow function syntax in TypeScript
- What is the syntax for input parameters (variables) in a MySQL query?
- What is a standard for commenting a function in JavaScript?
- What is the (function() { } )() construct in JavaScript?
- What is the currying function in JavaScript?

Advertisements