Comment

Comment by sillysaurusx

The URL https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... is also close to valid code as an expression.

Consider something like:

  foo ? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label
I was hoping that was where the post was going with this :)

Sadly, JavaScript doesn't have the // operator (floor division) so it doesn't quite work. And double-sadly, I can't think of a language that has all the necessary ingredients; Python uses `and` and `or` for trinary syntax, not ? and :, and besides, you'd need to be able to overload the // operator as unary rather than binary, which ... well, I'm not sure we'd want a language to be able to do that. But I do!

Still, if you want to confuse your coworkers, consider sneaking in something like:

  developer = {mozilla: 42}
  en = US = docs = web = Web = JavaScript = Reference = Statements = label = 420
  console.log(developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label)
and be sure to hand in your resignation after pushing the commit.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton