Results 1 to 2 of 2
  1. #1
    ScyllaAndara is offline Member
    Join Date
    Jul 2014
    Posts
    1
    Rep Power
    0

    Default Stuck on Code Academy 1.4 even if I've gone ahead Brevity is the soul of programming

    Brevity is the soul of programming
    You may have noticed that when we give a variable the boolean value true, we check that variable directly—we don't bother with ===. For instance,

    var bool = true;
    while(bool){
    //Do something
    }
    is the same thing as

    var bool = true;
    while(bool === true){
    //Do something
    }
    but the first one is faster to type. Get in the habit of typing exactly as much as you need to, and no more!

    If you happen to be using numbers, as we did earlier, you could even do:

    var myNumber = 1;
    while(myNumber) {
    // Do something!
    }
    Instructions
    We've written the less succinct version in the editor. Correct it to the more elegant version!

    ?
    Stuck? Get a hint

    Hint
    Your condition should only be:

    while(bool)

    That's the hint. Here is what I have in the editor. It constantly freezes up my browser.


    var bool = true;

    while(bool === true){
    console.log("Less is more!");
    bool = false;
    }


    var bool = true;
    while(bool){
    console.log("Less is more!");
    bool = false;
    }
    \



    var bool = true;

    while(bool = true){
    console.log("Less is more!");
    bool = false;
    }

    var bool = true;
    while(bool){
    console.log("Less is more!");
    bool = false;
    }

    They expect you to take out all the equals signs at which point the said browser, even in Opera has frozen up. I'm very desperate to solve this problem. Any help would be appreciated. I went ahead and got every possible point but I'm still very very stuck. I don't get what I'm trying to do at all and have exhausted every combination of bool.


    Thanks,


    Scylla

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,620
    Rep Power
    5

    Default Re: Stuck on Code Academy 1.4 even if I've gone ahead Brevity is the soul of programm

    I think you have the wrong forum. This is a Java forum, not a JavaScript forum.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. Programming Stuck!!
    By Ark3 in forum New To Java
    Replies: 24
    Last Post: 07-16-2014, 10:44 PM
  2. Replies: 0
    Last Post: 06-24-2014, 05:12 PM
  3. help..stuck w/ a java programming assignment
    By clemsontigers in forum New To Java
    Replies: 16
    Last Post: 02-19-2014, 04:16 AM
  4. Stuck on Programming
    By tabchas in forum New To Java
    Replies: 3
    Last Post: 04-30-2011, 11:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •