[understandinges6] found errors

Skip to first unread message


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

Aug 18, 2017, 12:13:24 PM8/18/17
to Zakas Books
Thanks, this was previously reported and fixed:
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
0 new messages