On this podcast we talk about the function prototype method apply. Function dot apply is used to set the this context in the function is invoked for. Here are some quick code examples for Function.apply():
const x = {a: 42, b: 15};function myFunction() {return this.a + this.b;}myFunction.apply(x)// returns 57
The post 005.5 – Javascript Pro Tip – Function.apply() appeared first on Full Stack Javascript Podcast.
Podchaser is the ultimate destination for podcast data, search, and discovery. Learn More