#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Need Help in making a Javascript code


    Dear All,

    Please help me in creating a Javascript code for the below structure.





    Thanks
  2. #2
  3. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0
    I'm new to JS but this works for me
    Code:
    for (var x = 20; x >= 8; x -=3){
        if (x < 10){
            console.log("The end");
        } else {
            console.log(x);
        }
    }
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0
    Actually, I've decided this while loop will be better

    Code:
    var x = 20;
    while (x >= 10){
        document.write(x + "<br>");
        x = x - 3;
    }
    document.write("The end");

Similar Threads

  1. code of making community
    By minati in forum .NET Development
    Replies: 0
    Last Post: March 1st, 2009, 11:45 PM
  2. Replies: 0
    Last Post: January 11th, 2008, 01:53 PM
  3. Making sure code only looks at this directory.
    By red_fiesta in forum ASP Development
    Replies: 4
    Last Post: December 12th, 2006, 10:56 AM
  4. JavaScript prompt when code is used without [code] tags!
    By baseballdude_ in forum Suggestions & Feedback
    Replies: 9
    Last Post: April 9th, 2005, 02:07 PM
  5. making code run
    By RdKirb49 in forum Microsoft Access Help
    Replies: 2
    Last Post: July 1st, 2004, 12:02 PM

IMN logo majestic logo threadwatch logo seochat tools logo