Skip to content

JavaScript Foundations

Oliver Foster edited this page Jul 25, 2022 · 18 revisions

Introduction

Below are some short lessons and resources on programming concepts.

The "event loop"

As a single threaded language, JavaScript or ECMAScript, can only execute one line of code at a time. The currently running line is kept as part of a call stack (which you can see in your debugger) as a list of functions. Each new function, as it is executed, is pushed to the top of the call stack and popped from the top upon return. Using the callback queue and the event loop, built into the ECMAScript environment, it is possible to queue function calls on a new call stack for later execution. This is primarily how DOM events, such as click or scroll, are able to execute callback handler functions.

Video - What is the heck is the event loop anyway?

Set theory

A 'set' is, mathematically speaking, an unordered group/pile of unique items; think venn diagrams. Two sets can intersect, such that they have a series of indentical and potentially differing items. A set may be a subset or superset of any other, in that it contains only part of or includes the entirety of the second set. Sets can be joined in a union forming larger sets or split into further subsets.

Webpage - Basic set theory
Video - Introduction to set theory - Discrete Mathematics

jQuery Array lodash underscore sql CSS

Clone this wiki locally