Something like this is more ideal. 

https://github.com/jashkenas/underscore/blob/master/underscore.js#L48-L52