Нестандартные способы получить неопределенность

В нашем любимом JS

Как можно получить undefined в JS/ES ? Ну можно использовать слово undefined. А можно креативно подойти к процессу, так чтобы ваш код не сразу могли понять последователи:

console.log( void 0 === undefined );
console.log( void 'послание программисту' === undefined );
console.log( 1[0] === undefined );
console.log( 0..n === undefined );
console.log( false[0] === undefined );
console.log( true[1] === undefined );
console.log( false.true === undefined );
console.log( ''.null === undefined );
console.log( 'послание'['программисту'] === undefined );
console.log( (_=>_).nop === undefined );
console.log( {}.nop === undefined );
console.log( ''[''] === undefined );
console.log( [][0] === undefined );
console.log( []._ === undefined );
// etc...

Вот как-то так :)

UPD

Варианты от читателей из комментариев:

/_/._// Бензовоз
(_=_=_=_=_=>_)[_]
// Грузовик
(()=>{})()
// Взрыв мозга
(_=[])[_?!!_++:~~~~_--]

Пишите в комментариях свои способы нестандартно получить undefined


Лайк, хлопок, шер. Слушайте меня в iTunes, подписывайтесь на Телеграм канал или Вконтакте.

Александр Майоров / Alexander Mayorov — ProWEBIT

Written by

Активист программного комитета FrontendConf. CTO and co-founder at New.HR & GeekJOB.ru

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade