Using anonymous self excuting function for object property in javascript