More to explore

In this module, we give a brief introduction to several of the aspects of JavaScript not covered in the other modules in this course. The intention of this module is not to give thorough coverage of any of the topics, but rather to explain enough to whet your appetite to learn more.

Natural next steps include both general programming topics, such as creating objects and methods, structuring data (not covered in this course), using recursion, and topics specific to JavaScript, such as the use of regular expressions.

If you are already comfortable with the programming concepts of creating objects and recursion please proceed to the next step.

In-depth background from our introductory programming course

Brief review of programming concepts: creating objects

A type of object is known as a class, where each object in a class has the same set of properties, but possibly different values for each one.

When defining a class, one can also define methodsA function associated with a class., functions which apply only to objects in the class.

Brief review of programming concepts: structuring data

Arrays and objects are two of many ways of structuring data. In case you are looking for associative arrays in JavaScript, you might need to wait, as they are not yet supported. For other ways of structuring data, there are many different data structures that are widely used in programming languages. Since we are not covering them here, perhaps that is one of the next steps for you to take in your explorations.

Brief review of programming concepts: recursion

The idea behind recursion is very simple: you can write a function that calls the function itself. Although this sounds like a paradox, it is not: the key is to call the function on input that that is closer to the base case than the original input. A base case is a case for which the function does not need to be used, so the problem can be solved directly. In contrast, for a recursive case, the function is used one or more times.

It is crucial to ensure that you always have a recursive case, so that you can use the function again, and that you always have a base case, so that your function calls do not continue forever.