I just started working a bit with javascript but quickly got stuck with a - in my eyes - quite simple task of returning an object literal.
The code I currently have looks like this
function wrapInObject(x)
{
return
{
y: x
};
}
console.log(wrapInObject('someValue'));
but instead of writing the object literal to the console it prints undefined
- I tried calling the function with numbers or other object literals but nothing helped.
Thanks for any help!