javascript check if object property is not undefined