Snippets
Referencing this
inside a callback can be tricky, since this
refers to the context where the function is called, not where it is defined. To explicitly bind this
to the defining context, use the bind()
function:
To find the first element of an array satisfying some criteria, use Array.prototype.find(). If you just need the index, use .findIndex instead. (via StackOverflow)
Log the current stack to the console:
Last updated