build with purpose


Javascript Object Creation

Object creation in Javascript is dead simple from a data type perspective: var obj = {a: 'Ben', b: 'Hofferber', c: 'Boise, ID'} typeof obj // object The datatype is straightforward and is really easy to implement. With JSON we can directly pass these objects into our javascript applications to be used immediately. I've even gone a bit further to look at the byte size of the object using a node library object-sizeof: