i tried a tutorial from their site and i encountered this error and i dont know what is wrong. This is the code:
function formatName(user) {
return user.firstName + ' ' + user.lastName; //this is line 16
}
const user = {
firstName: 'Ciofliceanu';
lastName: 'Serban';
};
const element = <h1>Hello, {formatName(user)}</h1>;
ReactDOM.render(element, document.getElementById('root'));
I expect the output to be Hello, Ciofliceanu Serban but the output is: ./src/App.js Line 16: Parsing error: Unexpected token
userwith commas?