Identation with Factory Functions

I have facet a problem with Factory Functions when trying to make the exercise from that topic.
Here is the correct code without errors

const robotFactory = (model, mobile) =>
{
  return {
    model: model,
    mobile: mobile,
    beep() 
    {
      console.log('Beep Boop');
    }
  }
}

but if I ident the code like the example above

const robotFactory = (model, mobile) =>
{
  return 
  {
    model: model,
    mobile: mobile,
    beep() 
    {
      console.log('Beep Boop');
    }
  }
};

I get the error “SyntaxError: Unexpected token :”. I used to ident code like my examples and I find out that javascrit is a litle nitpicking with identation. Read somewhere that the javascript interpreter puts a semicolon after the rerturn, I’m not sure.
Is this transversal to all development environments with javascript?
I’m sorry if my English is not the best…

Indentation doesn’t have an effect on the interpretation of the code, but a line break after the return keyword does. If you want to return a value (or an object in this case) it has to be or start on the same line as the return keyword. Everything after the return statement will not be executed anymore.