countable/js-fdf — pull request #4 by droppedonjapan (2014-02-21 17:42:04+00:00)
Title: Fixed Array Checks and Object Enumeration

JavaScript is a fickle beast. As it is now, the typeof checks for an array value doesn't get fired. When you `typeof []` it returns `"object"`, rather than `"array"` as you would expect.

I fixed this check using the `Array.isArray()` call. Honestly I'm not sure in what situations this would be used when writing to PDF's, so if you could supply a use-case I can check this to ensure it works as expected.

When you enumerate over objects, you also need to check to ensure prototypes do not get included in the data. Most of the time this shouldn't be a huge issue, but when you start creating new types of objects, you can run into situations where custom-set prototypes can get included as well. As a user you can get around this using `Object.defineProperty()`, so if you don't want this check in, I can remove it.

Check out the second answer on this SO question on that:
http://stackoverflow.com/questions/208016/how-to-list-the-properties-of-a-javascript-object