how to get a subset of a javascript object properties