Last Updated: May 15, 2019
·
762
· havvg

Pass related objects when triggering events

Keep in mind while using Underscore.js and Backbone.js to pass in the related object for any event you trigger.

By default the current scope will be the related object within the callback.
When using _.bind() or _.bindAll() this scope may be altered according to the callback in use - see example.

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside