Avoiding boolean traps in es6