Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript About setTimeOut in javascript

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #144847
    omryk
    Participant

    i have this code

    setTimeout(function () {console.log(‘1111:’);
    },0);

    var start = new Date;
    while (new Date - start < 3000) { } //wait 3 seconds 
    console.log("2222 " );///////////////
    
    console.log("3333 ");//////////////////|
    

    the output is
    2222
    3333
    1111

    why?

    #144860
    omryk
    Participant

    but i dive the settimeout the second parameter “0”, so it dowsnt matter what will be the second parameter? always will be 1111 be written last ?

    #144942
    meisp123
    Participant

    Chinese history, one of the most successful teams, only one team has won the title of Intercontinental Champion. Although the team is in trouble, but still remain competitive at the top. Red is the dominant color of Liaoning soccer jerseys for cheap
    , without impurities. Although not surprising, but in a red shirt with black shorts and socks and between good design. Jersey, which, however, did not confirm, but it should be al

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.