Note that this course was recorded in 2011 and therefore does not cover any of the new ES2015 features. However learning the earlier version of the language is a good idea in my opinion. This one of the first Pluralsight courses I ever watched, which was back in 2012. At that time, I learned that I had a lot left to learn about this language. I enjoyed watching this course again today.
In 2016, js db still works fine, but Node is a more popular option for programming in a REPL, and Chrome has a decent one inside its dev tools.
Beginning with comments, we learn how to do both single and multi line versions.
Variables should be declared using the var keyword.
Liam uses the typeof keyword for showing which primitive types a variable belongs to.
Two of these primitive types are null and undefined. Liam explains the difference between these. Null is the absence of a value, so you will generally only find it a variable has been explicitly set to null.
There are many type coercion problems that you can run into with the == operator, so Liam’s examples use === and !== except to show
This module begins declaring functions and we learn that we can declare either named or anonymous functions. There are also immediately invoked functions and Liam explains the benefits of using these.
The arguments object behaves like an array but is of the type object.
Recursion means a function can call itself. This is a very useful feature but you must ensure that there is a definite reachable exit, otherwise the function we continue to run until the program is shut down or runs out of memory.
Liam shows an example with an outer, middle and inner function.
Iteration explains the for loop and the for..in loop, which is similar to foreach in C#
It also explains the while loop and the do…while loop
Error Handling covers throwing and catching of exceptions and explains a try catch finally block.
Types and Libraries
If you have watched Scott’s introductory course, you will already have come across most of the built-in types. This module will fortify that knowledge with additional information.
String is a type that should be familiar already. Liam explains the common string escape sequences with an example using JS bin including outputting Unicode symbols.
String Methods begins with string concatenation (using the + operator) , then charAt, indexOf, replace and many others are mentioned and demonstrated with examples.
Arrays are indexed collections and each element can be of any type. Liam provides many examples of working with arrays, including slice and splice functions.
Regular Expressions are a tool for string pattern matching. They are used for searching, replacing, and extracting parts of strings.
If you would like to learn more, see my article on Learning Regular Expressions
Liam shows some equivalent JSON and XML data side by side, and the difference is striking: JSON is much less verbose and much easier to read than XML. Parsing JSON data is a better alternative to using eval.
isNaN is a simple function taking one argument and returning true if the argument is NaN: not a number.
parseFloat is a function for converting a string into a number.
Liam covers five functions that are part of the math object: abs, floor, ceil, low, random
Firebug is a developer tool add-on for Firefox. At the time when this course was recorded, it was an essential tool for Web developers. However in the last 5 years browsers have come on a long way. If you are interested in gaining an in depth understanding of debugging on the web, here are a couple of alternatives:
Shawn Wildermuth has a course called debugging the web with firebug, webdeveloper and fiddler
John Sonmez has a course called Using the Chrome developer tools
Jasmine is a behaviour driven development testing framework and is the testing framework that I have used most often over the past 18 months.