[javascript] How to get a subset of a javascript object's properties