How to use !function in javascript
To use what? If you don't know basics of the language you need to learn it here: https://javascript.info/ , not on the website for ready scripts.
! means not...
function FunctionName() //Creates a variable named FunctionName
{ //Starts the function
var VariableName = true; //Creates a new variable with the value of true
if (VariableName !== false) //Check if the variable VariableName is NOT equal false
{ //Starts the function
alert('yes the variable VariableName is NOT equal true'); //If the variable VariableName is NOT equal false show a message
} //Finishes the if condition
} //Finishes the function
FunctionName(); //Executes the function....
Please delete that script or make it unlisted...
@hacker09, it's a library so it's intended to be used by other scripts. Don't make hasty judgments.
@Jonas12, what you saw is a well-known method to make IIFE, see https://flaviocopes.com/javascript-iife/
Ok.
He just showed 3 weird function syntaxes using unary operators, but didn't explain why they are weird and what makes them better or worse than arrow functions
"Weird" because there's no reason to use those unary operators but some people may still want to just for fun or to make the minified output shorted by a few characters. Also, IIFE is not better or worse than an arrow function because it's not an alternative: you can use them together e.g. (() => { ....... })()
er, "shorted" -> "shorter"
Did you see the title?To use what? If you don't know basics of the language you need to learn it here: https://javascript.info/ , not on the website for ready scripts.