|
|
|
|
|
by btipling
4824 days ago
|
|
I'd say I like how the thing does what it does, and I even like the overall simplicity of each of the functions which seem easily testable. I just don't like the JavaScript very much. > var node = arguments; > node.i = results.push(undefined) - 1; ... Adding properties to an arguments object, assigning the arguments object (which is not an Array, only array-like) to a variable, pushing undefined onto an array and subtracting by 1 to get the latest index. This isn't clever, it's silly. Simple is better than complicated. They're passing a special array-like object all over the place, note: > slice.call(node, 1), They do this because slice isn't on arguments. They are using an arguments outside of the function's scope. The var statement in a while loop gives me the impression this person doesn't know how scope works in JavaScript. |
|
The "connivence" taken with some of the other parts of the code (particularly the complicated one liners) I'll raise an eyebrow over, but they show a deep understanding of javascript. However I'm not fond of conciseness over simplicity.