whenever you see this in JavaScript code, you never quite know what it’s referring to.
What are Bloom filters?
Jamie Talbot
4.6K48

Oh please, you* know exactly what it is: a reference to the context that the function is called from. By convention, this is the class (object) that the function is a part of, but with `bind` you can change it to whatever you want. I’d agree that it’s weird, can make code hard to reason about when misused, and encourages the use of a semi-implicit shared state between functions, but it’s not magic.

*I mean “you” in a figurative sense, maybe the literal you doesn’t know.

Like what you read? Give Sean Lang a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.