Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. var obj = {
  2. name: 'One',
  3. hello: function() {
  4. console.log(this.name);
  5. }
  6. };
  7.  
  8. var obj2 = {
  9. name: 'Two'
  10. };
  11.  
  12. var toCall = function(callback) {
  13. callback();
  14. }
  15.  
  16. toCall(obj.hello.bind(obj2));
  17. obj.hello();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement