Define method in ecma script 6

Here is how we define a method in ecma script 6…

let hello = {
	greeting() {
		console.log("hello world!"); // output "hello world"
	}
}

Like this post? Kindly share!