I am working on SCEditor and encountering one useless Javascript feature after the other. I am removing them all to make the code understandable. For example, removing useless bind() changes:
function isTypeof(type, arg) {
return typeof arg === type;
}
var isString = isTypeof.bind(null, 'string');
var isUndefined = isTypeof.bind(null, 'undefined');
var isFunction = isTypeof.bind(null, 'function');
var isNumber = isTypeof.bind(null, 'number');
to:
function isTypeof(type) {
return function(arg) {
return typeof arg === type;
};
}
var isString = isTypeof('string');
var isUndefined = isTypeof('undefined');
var isFunction = isTypeof('function');
var isNumber = isTypeof('number');
SCEditor is much better than most modern crap, but it is still full of bad code like this. I am removing bind(), call(), apply(), all classes, and any other uses of useless features.
[–]TaseAFeminist4Jesus 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 0 fun3 insightful - 1 fun - (2 children)
[–]fschmidt[S] 3 insightful - 1 fun3 insightful - 0 fun4 insightful - 0 fun4 insightful - 1 fun - (1 child)
[–]TaseAFeminist4Jesus 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (0 children)
[–]GeorgeCarlin 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (2 children)
[–]fschmidt[S] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 1 fun3 insightful - 2 fun - (1 child)
[–]GeorgeCarlin 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (0 children)