javascript function without brackets code example
Example 1: javascript if without brackets
if (true)
alert("Condition is true");
else
alert("Condition is false");
// Only one line immediately under the if statement, or else its a syntax error.
Example 2: javascript function in brackets
(function() {
// code
})();