It's already explained but you are re-assigning your name variable (the string) to the function.
I'd do this:
// Good :D
const myName = 'Richard';
const logMyName = () => {
console.log(myName);
}
/*
This example below will throw an
error because you can't re-assign
a constant variable so use the
one I wrote above :)
*/
// Bad :(
myName = () => {
console.log(myName);
}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's already explained but you are re-assigning your name variable (the string) to the function.
I'd do this: