Search code examples
javascriptajaxfacebooklong-polling

What is for(;;) in Facebook long poling request?


Hi i have question which means for (;;); in Facebook long polling request ? This statement is in every file which is long polled from Facebook server.

Thank you


Solution

  • No way this infinite loop is executed; just try it in your console. A simple operation like integer incrementing will freeze your screen:

    
        var a = 1;
        for (;;) {
            a++;
        }
    
    

    It may be just a small trap for anyone who tries to eval their script, or something.