The Binding Concept in Javascript

Written by sona | Published 2020/10/13
Tech Story Tags: javascript | frontend | web-development | front-end-developer | call | apply | bind | programming | web-monetization

TLDR Javascript binding is done using the Bind() method. With the help of the bind method, we can make one common function and bind different objects, so that the function gives different results when it's needed. The bind() method creates a new function, when invoked, has the this sets to the provided value. In the above example, we are storing a reference of info.printFunc to printFunc2 variable, so calling it without an object reference, so this will now refer to the window (global) object or undefined (in strict mode)via the TL;DR App

no story

Written by sona | FrontEnd Developer
Published by HackerNoon on 2020/10/13