Closed qifuren1985 closed 7 years ago
There are about a million places where people talk about how to check if something is undefined. I'm not even try to convice you that typeof myVar === 'undefined'
is the "proper" way but if have some time to kill Google it..
EDIT: Clarification: context.result != undefined
should be typeof context.result !== 'undefined'
@qifuren1985 is right, if result = x${filter}
evaluates to something falsey, the filter is considered invalid.
In Editor.js, line 166 has a bug. if result is empty string or 0, it will run through jq. if (context.result) { ..... } should be if (context.result != undefined) { ..... }
test code: if(""){alert(1)} //nothing happen if(0){alert(1)} //nothing happen if("1"){alert(1)} // will alert