Some built-in methods in JavaScript can actually be chained together on the same line of code. This tutorial explains how that works by building a custom object that has the same ability.
Code GIST: https://gist.github.com/prof3ssorSt3v3/2e115d6e0e955ff40facfede08e562b3