• call and apply

    In JavaScript, functions are just objects. This means that you can attach functions to them, just as you can with any other object. Some defaults that come along with being a function are `.toString()`, `bind()`, `call()`, and `apply()`. We're going to tkae a closer look at two similar, but slightly different methods: `call()` and `apply()`.

    Read more...

  • Using $apply() and $digest()

    Understanding Angular's `$apply` and `$digest` methods require a bit of background on how the browser renders the DOM. The browser has an event loop that will tell it how to display a page. The browser's event loop initiates when any of the three events occur:

    Read more...

  • JavaScript Closures

    Contrary to popular belief, a closure is **not** a function. It is a **combination** of an inner function and its reference to its lexical environment (scope). They allow access to an outer function from an inner function. ### What are inner/outer functions?

    Read more...

  • define_method

    There are multiple ways of defining methods in Ruby. The most popular is by using a block, via `def` and `end`. One cool thing about Ruby is its **metaprogramming** (being able to write code that writes code) capabilities. As an example, take a look at this `Baby` class definition. ### A Baby example

    Read more...

  • box-sizing: border-box

    The `box-sizing` property is used to tell the browser how to calculate the width and height of an element. By default, this is set to `content-box`, which may cause some unexpected behavior for someone new to CSS. `content-box` tells the browser:

    Read more...