Skip to content

shihaohong/keyword-this-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

'this' Keyword Workshop

This is a repository to test your understanding of the keyword 'this' in JavaScript.

Pointers

What determines the value of 'this'?

  • determined by how a function is called
  • can't be set by assignment during execution

Main patterns:

  • global reference (this usually refers to global object)
  • free function invocation (global object)
  • call/apply (first argument to call/apply)
  • method invocation (object on the left of dot, at call time)
  • construction mode (new object created for that invocation)

How to use repo:

  1. Fork this repo and clone to your local machine
  2. Open src/this.js. DO NOT OPEN spec/thisSpec.js or SpecRunner.html YET.
  3. Code your solutions to the problems based on the prompts
  4. Review your solutions and once you're satisfied, open up SpecRunner.html to check your results.
  5. Learn from your results and revisit workshop as necessary.

Author: Shi-Hao Hong (@shihaohong)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages