Expected method shorthand.
2265 input: function () {
2266 nuSubformFilterRows(sfName, nuSubformFilterArray(sfName, filter[sfName]))
2267 },
2268 focus: function () {2269 if (propDatalist === true) { nuSubformFilterAddValues(sfName, 'search', columnId) }2270 }2271 },
2272 id: filterId
2273 })
Expected method shorthand.
2262 type: 'search',
2263 class: 'nuSubformFilter',
2264 on: {
2265 input: function () {2266 nuSubformFilterRows(sfName, nuSubformFilterArray(sfName, filter[sfName]))2267 },2268 focus: function () {
2269 if (propDatalist === true) { nuSubformFilterAddValues(sfName, 'search', columnId) }
2270 }
Expected method shorthand.
2242 change: function () {
2243 nuSubformFilterRows(sfName, nuSubformFilterArray(sfName, filter[sfName]))
2244 },
2245 focus: function () {2246 nuSubformFilterAddValues(sfName, 'select', columnId)2247 nuSubformFilterSortOptions(sfName, columnId)2248 }2249 },
2250 append: [
2251 optionAll,
Expected method shorthand.
2239 id: filterId,
2240 class: 'nuSubformFilter',
2241 on: {
2242 change: function () {2243 nuSubformFilterRows(sfName, nuSubformFilterArray(sfName, filter[sfName]))2244 },2245 focus: function () {
2246 nuSubformFilterAddValues(sfName, 'select', columnId)
2247 nuSubformFilterSortOptions(sfName, columnId)
Description
ECMAScript 6 provides a concise form for defining object literal methods and properties. This syntax can make defining complex object literals much cleaner.
Here are a few common examples using the ES5 syntax:
const x = 1, y = 2, z = 3;
// properties
const foo = {
x: x,
y: y,
z: z,
};
// methods
const foo = {
a: function() {},
b: function() {}
};
The ES6 equivalent syntax is::
// properties
const foo = {x, y, z};
// methods
const bar = {
a() { return 1 },
b() { return 2 }
};
NOTE: The shorthand properties are equivalent to function expressions.
Meaning that they do not bind their own this
inside their bodies.
It is still possible to access properties from the object inside a shorthand member function:
const object = {
x: 1,
getX() {
return this.x // valid
}
}
Bad Practice
const foo = {
bar: function () { return 1 }
};
Recommended
const foo = {
bar() { return 1 }
}