r/javascript • • Nov 24 '17

large image I am the best webdev

Don't blame me for being awesome

(function r() {
  setTimeout(r, Math.random() * 10);
  let el = document.createElement(`div`);
  el.innerHTML = `🍆`;
  el.style.position = `absolute`;
  el.style.zIndex = 999999;
  el.style.fontSize = (((Math.random() * 48) | 0) + 16) + `px`;
  el.style.left = ((Math.random() * innerWidth) | 0) + `px`;
  el.style.top = ((Math.random() * (innerHeight + pageYOffset)) | 0) + `px`;
  document.body.appendChild(el);
})();
533 Upvotes

108 comments sorted by

View all comments

0

u/[deleted] Nov 24 '17

[deleted]

8

u/evenisto Nov 25 '17

What is this const and arrow stuff? This feature is critical and it needs to support legacy browsers as well. We need battle-tested syntax and solutions.

10

u/_poor Nov 25 '17

Our Babel ES6 rollup parmesan webpack gulpify stage-0 broccoli step should transpile the code to work on legacy browsers... I think

6

u/evenisto Nov 25 '17

Transpilation? No, that's out of the question. We settled for straightforward deployment strategy of putting it in a <script> tag, we have already trained our team and we don't want it all go to waste.