开发
web-frontend
js
es
ES2015
Dynamic Property Name

Dynamic property name

let lastName = "姓",
	fristName = "名"
 
const obj = {
	demo: "sdf",
	eat() {
		console.log("eat")
	},
	[lastName + fristName]: "Scoheart"
}
 
console.dir(obj)