Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in /javascript_refresher/product_inheritance_with_extend.js #2

Open
jryu01 opened this issue Sep 16, 2014 · 2 comments
Open

error in /javascript_refresher/product_inheritance_with_extend.js #2

jryu01 opened this issue Sep 16, 2014 · 2 comments

Comments

@jryu01
Copy link

jryu01 commented Sep 16, 2014

I appreciate your great work for this book and I'm happy to find this book.
I found small error while playing around with some code in this file.

https://github.com/marcoemrich/bdd_book/blob/master/javascript_refresher/product_inheritance_with_extend.js#L5
Object.prototype.extend = function(props) {
for (var prop in props) { this[prop] = prop; }
return this;
};

For this code, second line, this[prop] = prop should be this[prop] = props[prop] to it to be working correctly.

@jangelroa
Copy link

jryu01 is right.

@marcoemrich
Copy link
Owner

Thanks, I'm glad you like the book! Sorry for the late response - I'm up to
my ears in work. I will fix it soon.

On Sun, Aug 16, 2015 at 9:31 PM, Jose Angel Roa Gomez <
notifications@github.com> wrote:

jryu01 is right.


Reply to this email directly or view it on GitHub
#2 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants