Joel.Watson92@gmail.com | LinkedIn: /in/joel3rbear | Twitter: @Joel3rBear
One of the benefits of JavaScript not enforcing types is that you are able to create arrays that hold multiple types since all arrays are arrays of ‘objects’.
One of the cons of JavaScript not enforcing types is that sometimes you must write in your own type checking in order to avoid weird situations where you recieve the incorrect type as a parameter for your function.
When you are doing functional programming with pure functions, you dont want to change the data in the parameter. Instead you want to return a different object with the new data. This gives you the ability to run the functions in any order and still get the same results without side effects.
One type in javascript that has rules is an object. Every object has to contain a pointer to some address in memory. An extention of this is an array. An array object in javascript has a pointer to an address in memory where it stores a number of pointers to other addresses in memory(for the indexes of the array).