Yep, that's my face

Troy Lamerton

Data types

15 May 2016

Javascript has various datatypes.

Numbers can be whole numbers or decimals and Javascript allows seemless conversion between the two.
Booleans are like switches, they are either on (true) or off (false).
Objects encompass the other common datatypes, which includes arrays, that a special type of object.
There are a few more datatypes, like Map and Set, but these are fully supported by all browsers yet.

One of the most useful datatypes is the array. It is simply an ordered list of values. These values can be other datatypes: numbers, booleans, or even arrays. The big drawcard for arrays is that they can be iterated over. Your code can quickly look at each thing in the array and use it for something.

Before this week, I had never come across passing a function to another before. This is a concept that is unique to Javascript. It allows functions (that are passed a function) to be more abstract and universal. This means a function isn't locked down to a particular task, it achieve varying results based on its input.

A concept that popped up in the assignments a few times this week was recursion. A function that calls itself. I am still coming to terms with how to implement these, occasionally pulling my hair out in the process.