utilities
for education
Babel + JSX
let _ = {
noop() {},
now() {
return new Date().getTime();
},
result(object, property, defaultValue) {
let val = object[property];
if (typeof(val) === 'function') {
val = val.call(object);
}
return val || defaultValue;
}
}