Why do I keep getting a syntax error?


#1

The following code keeps getting a syntax error & I’m not sure why. Everything looks defined. I have the semicolons at the end. I just don’t see the problem!

let myArray = []
myArray.push( ‘Antonella Morales’,‘antonella.maria’);

const cutName = (antonella) => {
return name.split (’ ');
};
//console.log(cutName(‘Antonella Morales’));

let myInfo = {
fullName: cutName(Antonella Morales),
skype: ‘antonella.maria’,
github: ‘n/a’,
};

All advice will be taken graciously. I’m still learning!


#2

Did you mean to write name as the parameter?


#3

Yes! I did mean to. Did I do it? I wasn’t sure if I was supposed to write my name in the split.


#4

The split() method takes a separator string, so there is no problem with that expression. Where the issue is found…

const cutName = (antonella) => {
  return name.split (’ ');
};

The name object is undefined since it is not in the parameter.