The other day I was a bit tired, I wrote this JavaScript code:
var obj = {a(toto){console.log(\"func a: \", toto);} };
This is ECMAScript 6 syntax. Depending on your environment - node vs browser - it may or may not be advisable to use this syntax (e.g. not supported cross browser).
Given the following code:
var obj = { foo: function() {}, bar: function() {} };
You are now able to shorten this to:
var obj = { foo() {}, bar() {} };
Reference: Method definitions (ES6)