I need to write in my object some properties with the '
character
e.g.
const championsList = {
Kha'Zi: '...',
};
How can I do that?
I need to write in my object some properties with the '
character
e.g.
const championsList = {
Kha'Zi: '...',
};
How can I do that?
You can do so by wrapping the property in quotation marks, having a property like this does mean you'll have to access it using brackets:
const championsList = {
"Kha'Zi": "...",
};
console.log(championsList[ "Kha'Zi" ]);