This shorthand syntax is also known as the concise method syntax. It’s valid to have spaces in the property name.
let server = {
name: 'Server',
restart() {
console.log("The " + this.name + " is restarting...");
},
'starting up'() {
console.log("The " + this.name + " is starting up!");
}
};
server['starting up']();
Code language: JavaScript (javascript)