recently seen in some JS code

for(var i=0;i<1/0;i++)

what the HELL

@danielhglus i<Infinity? why not just for(var i=0;;i++)?

@ben hmm, on further reading it looks like the idea is to infinite-loop the browser?

for(var i=0;i<1/0;i++)document.location.href="#",window.history.back(),window.history.forward();

gotta say, this is some weird stuff

@danielhglus hmm

seems like a denial of service exploit

also if there are no braces in that it'll never get to the window.history command

@ben look closer - commas, lol

what a bizarrely written snippet

and it's actually in some code to handle user input

@danielhglus seems like it'd just spam the browser history forever

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!