Esta sintaxis de taquigrafía también se conoce como sintaxis del método conciso. Es válido tener espacios en el nombre de la propiedad.
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)
Said HR