7 kyu

Anonymous Returns.

2,331 of 2,349cloggy45

Description:

When a function is called by itself it is bound to the global context; the this variable of the function will be bound to the global object.

When the getNameFunc function is called on the alpha object the value of the name variable outside of the object is returned: "The Window".

We do not want this, we want the value of the name property inside the alpha object to be returned.

Fix getNameFunc so the right value is returned.

For more information: Binding

Debugging

Similar Kata:

Stats:

CreatedJul 27, 2014
PublishedJul 27, 2014
Warriors Trained3474
Total Skips148
Total Code Submissions6969
Total Times Completed2349
JavaScript Completions2331
CoffeeScript Completions33
Total Stars27
% of votes with a positive feedback rating85% of 218
Total "Very Satisfied" Votes164
Total "Somewhat Satisfied" Votes43
Total "Not Satisfied" Votes11
Ad
Contributors
  • cloggy45 Avatar
  • jhoffner Avatar
  • jackdalton Avatar
Ad