Preview:
There are 4 ways the value of this is set inside functions, depending on the makeup:

1. A simple function call, like the kind you learned about in our earliest JavaScript chapters
2. When calling a function as an object method
3. Explicit binding by using the call(), apply(), and bind() methods
4. When the function is used as a constructor, using the new operator
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter