Creating a variable in JavaScript is called "declaring" a variable.
No difference in JavaScript. The only requisite is that the last quotation mark matches the first quotation mark. In other languages they may have different applications but in JavaScript they are exactly the same.
for statement , while statement , if statement , they are all actions, in another word tasks, or behaviors. But for expression , we are talking about values, valuables, objects, or some procedures that can produce a value, like function. So Javascript also has function expression . Because function is a value .
For one of them the "()
" is inside, for the other one it is outside. Here they are:
var a = (function() {
return {
bla: function() {
console.log('a');
}
};
} () );
var b = (function() {
return {
bla: function() {
console.log('b');
}
};
}) ();
a.bla();
b.bla();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With