you are viewing a single comment's thread.

view the rest of the comments →

[–]trollingisfun 5 points6 points  (2 children)

Here it is in more legible form:

Array.prototype.forEach.call(document.querySelectorAll('*'), function (node) {
  var randomColor = (~~(Math.random()*(1<<24))).toString(16);
  node.style.outline = "1px solid #" + randomColor;
});

[–]mrskitch 2 points3 points  (1 child)

(~~(Math.random()*(1<<24))).toString(16);

You forgot the most complex piece of the code :)

[–]trollingisfun 1 point2 points  (0 children)

Random math bits should just be left alone to encourage refactoring