Check If Empty Object In Javascript Definition Functions