data object manipulation in JavaScript