I know the title is vague but I didn\'t know what to write.
In javascript, I know how to write functions that will be called like this :
argument1.func
You no longer need to specify the function keyword when defining functions inside objects:
var myObj = {
myMethod(params) {
// ...do something here
},
myOtherMethod(params) {
// ...do something here
},
nestedObj: {
myNestedMethod(params) {
// ...do something here
}
}
};
Equivalent except repetitive and verbose:
var myObj = {
myMethod: function myMethod(params) {
// ...do something here
},
myOtherMethod: function myOtherMethod(params) {
// ...do something here
},
nestedObj: {
myNestedMethod: function myNestedMethod(params) {
// ...do something here
}
}
};