[javascript] Set default value of javascript object attributes