Closed mdda closed 10 years ago
This seems much worse than the existing solution...
html
tag.arr
, via arr.splice(1)
, in order to use reduce
(which doesn't even work that well anyway since you have to pass arr[0]
as the seed).Although it does point out I should probably do the escape
in the loop instead of doing substitutions = substitutions.map(escape)
.
I'll leave this open to track that fix and the typo. Thanks!
Fixed and released as 0.5.2. Thanks!
Thanks for responding so quickly.
On your first point, I guess my main idea was to use the arrow function creation syntax, since it's so straight-through. You're right that putting it outside the function makes sense for efficiency (at the expense of some name-space pollution).
On the second, Yes : Good point that .splice(2)
is a whole array copy in Javascript, despite it aping .tail
elsewhere...
Thanks again for the great nodeschool unit!
Note that this is module code, not global code, so only the local module is polluted
From: Martin Andrewsmailto:notifications@github.com Sent: ý2014-ý07-ý25 13:13 To: domenic/count-to-6mailto:count-to-6@noreply.github.com Cc: Domenic Denicolamailto:domenic@domenicdenicola.com Subject: Re: [count-to-6] Tagged Templates (#15)
Thanks for responding so quickly.
On your first point, I guess my main idea was to use the arrow function creation syntax, since it's so straight-through. You're right that putting it outside the function makes sense for efficiency (at the expense of some name-space pollution).
On the second, Yes : Good point that .splice(2) is a whole array copy in Javascript, despite it aping .tail elsewhere...
Thanks again for the great nodeschool unit!
— Reply to this email directly or view it on GitHubhttps://github.com/domenic/count-to-6/issues/15#issuecomment-50177882.
When I just ran through this, the tagged templates lesson was the last one. So wouldn't the following solution seem more like a 'finale' (though seems from the Issues you've already added that you plan adding more lessons) :
Also (very minor) : Typo in #5 : "horrible arguments objet again"
Overall :: Very nice! Martin :-)