undefined === derp ? console.log('1') : console.log('2')
ReferenceError: derp is not defined

I would suggest: if (typeof derp === 'undefined') { ... }