Function
An object that represets a series of instructions.
Basic Example
function hello() {
return 'hello world';
}
hello();
'hello world'
Arrow syntax
const helloAgain = () => {
return 'hello again';
};
helloAgain();
'hello again'
If no {}
s are used the expression is implicitly returned.
const foo = () => 'bar';
foo();
'bar'