apply(). We’re going to tkae a closer look at two similar, but slightly different methods:
There are multiple ways of defining methods in Ruby. The most popular is by using a block, via
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
box-sizingproperty 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.
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.
$digestmethods 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.