Comment

Comment by btipling

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.

parent btipling 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton