marijnh / Eloquent-JavaScript

The sources for the Eloquent JavaScript book
https://eloquentjavascript.net
3.03k stars 799 forks source link

Chap 5: change variable name from "known" to "indexOfName" #297

Closed nielsbom closed 6 years ago

nielsbom commented 6 years ago

I think this name is more clear than "known". The latter sounds boolean to me and then counts[known].count++; looks weird.

marijnh commented 6 years ago

I don't really agree that it sounds boolean, and I prefer the old name. Also, the repeat function is part of the chapter's base code, so it doesn't have to be repeated every time it is used (later chapters will work this way too, building up programs piece by piece)