Closed hello2parth closed 4 years ago
There's a space at the beginning of the string literal in the original book text, so 3
is the correct index position. Moreover, as stated in the pre-filled text, I'm not accepting fixes to the first edition books anymore, since they're all being re-written for second edition.
var a = 'abc';
console.log(a.indexOf('c')) //2
Yes, I promise I've read the Contributions Guidelines (please feel free to remove this line).
Specifically quoting these guidelines regarding typos:
Please type "I already searched for this issue":
Edition: (pull requests not accepted for previous editions)
Book Title: You Don't Know JS
Chapter: 3
Section Title: Types & Grammar
Topic: Native Prototypes
https://github.com/getify/You-Dont-Know-JS/blob/1st-ed/types%20%26%20grammar/ch3.md#native-prototypes