javascript: (ä=#1={}&&alert)(ä)
Found this here http://sla.ckers.org/forum/read.php?2,15812,page=2
If you copy the title of the question and run it in the browser you should see that it's alerting the string representation of a funct开发者_如何学JAVAion.
function alert() {
    [native code]
}
Could someone explain slowly what's going on?
Starting with what happens first and workout out from there
- {} && alert—- {}is true, so- alertis evaluated and pushed left
- #1 = alert— assign- alertto the variable- #1(technically, you aren't allowed to use- #to start an identifier, but some browsers apparently let you get away with it (ditto- ä))
- ä = #1— assign- #1(- alert) to- ä
- ä(ä)— call- alertwith- alertas an argument
- alertautomatically calls- theFirstArgument.toString()which turns the function into a string
- You then get the rendered string
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论