function a() { return {name: 'foo', value: 123}; } var myVar = a(); alert( myVar.name ); //foo alert( myVar.value ); //123