[understandinges6] found errors

21 views
Skip to first unread message

mgryn...@yahoo.com

unread,
Aug 18, 2017, 10:52:34 AM8/18/17
to Zakas Books
I would like to report errors In Chapter 6 “Symbols and Symbols properties” (Ido not have page#, because I bought it as e-book)”.

In example on Symbol.replace overriding:

hasLengthOf10 = {
..., 
[Symbol.replace]: function( value, replacement) { return value.length = = = 10 ? replacement + value.substring( 10) : value; },
 ...

}

value.substring(10) expression in this context always evaluates to “undefined” and should not be there.

Also following 
 console.log( replace2); // "Hello John"

is incorrect and should be

 console.log( replace2); // “undefined”

Nicholas Zakas

unread,
Aug 18, 2017, 12:13:24 PM8/18/17
to Zakas Books
Thanks, this was previously reported and fixed:
https://github.com/nzakas/understandinges6/issues/373
--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakasbooks+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages