Functions

All functions return a value (similar to VBA)
If a value is not explicitly returned then 'undefined' is returned.
A function declaration that does not have a specific return will return undefined

function add (x, y) 
{
   var z = x + y;
}

Pure Functions

These are functions that have no side effects.
They do not change (or mutate) any of the arguments passed in


Constructor Functions

Also called an Object Constructor Function.
A constructor function is used to create objects
Classes > Constructor Function


© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopNext