How is
throw
{
name: 'type error',
message: 'provide numeric value'
};
a incorrect syntax when
throw{
name: 'type error',
message: 'provide numeric value'
};
Is a correct syntax?
Is it really necessary to attach curly bracket with throw and why?
throw {It does not have to be attached.returnstatement is also affected.. Its Automatic semicolon insertion. stackoverflow.com/a/27738985/3556874