marcoemrich/bdd_book

error in /javascript_refresher/product_inheritance_with_extend.js

jryu01 opened this issue · 2 comments

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.

jryu01 is right.

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).