Search

Primitive Obsession

By Chris Coyier on

I found this essay Primitive Obsession by Andrew Cairns interesting. The big example in it is this: Here the User function takes two string params, string being a primitive type, and here, quite easy to screw up by passing them in the wrong order and/or not pre-validating the values. If you agree, there are a […]

New JavaScript Set methods

By Chris Coyier on

Sets in JavaScript are quite useful as they are like an array, but can only contain one of a specific item. So you can unique-ify an array easily, and even willy-nilly add stuff to it and not worry about duplicates: Now they are even more useful with recently universally available methods, as Brian Smith summarizes: