Thread: Need Help in making a Javascript code

Results 1 to 3 of 3
Share This Thread →
  1. #1
    seliwat is offline Registered User ASP Free Newbie (0 - 499 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
    norman_bates is offline Registered User ASP Free Newbie (0 - 499 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);
        }
    }

  3. #3
    norman_bates is offline Registered User ASP Free Newbie (0 - 499 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");

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. code of making community
    By minati in forum .NET Development
    Replies: 0
    Last Post: March 1st, 2009, 10:45 PM
  2. Replies: 0
    Last Post: January 11th, 2008, 12: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, 09: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, 01:07 PM
  5. making code run
    By RdKirb49 in forum Microsoft Access Help
    Replies: 2
    Last Post: July 1st, 2004, 11:02 AM

ASP Free Advertisers and Affiliates