bdd_book icon indicating copy to clipboard operation
bdd_book copied to clipboard

error in /javascript_refresher/product_inheritance_with_extend.js

Open jryu01 opened this issue 10 years ago • 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 avatar Sep 16 '14 23:09 jryu01

jryu01 is right.

jangelroa avatar Aug 16 '15 19:08 jangelroa

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 < [email protected]> wrote:

jryu01 is right.

— Reply to this email directly or view it on GitHub https://github.com/marcoemrich/bdd_book/issues/2#issuecomment-131612198.

marcoemrich avatar Aug 25 '15 15:08 marcoemrich