I'm going through the third edition right now. At this point there is a code block formatted like this:
function characterScript(code) {
for (let script of SCRIPTS) {
if (script.ranges.some(([from, to]) => code >= from &&
code < to)) {
return script;
}
}
return null;
}
IMO it is much easier to read like this:
function characterScript(code) {
for (let script of SCRIPTS) {
if (script.ranges.some(([from, to]) => {
return (code >= from && code < to);
})) {
return script;
}
}
return null;
}
The switch from the fat arrow (=>) to greater than or equals (>=) will definitely confuse people, separating them with brackets makes it much more readable.
Awesome book, I'm learning a ton going through it!
Hey there,
I'm going through the third edition right now. At this point there is a code block formatted like this:
IMO it is much easier to read like this:
The switch from the fat arrow (
=>
) to greater than or equals (>=
) will definitely confuse people, separating them with brackets makes it much more readable.Awesome book, I'm learning a ton going through it!