Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #25439

Re: I need help with the following code.

From Tim Streater <timstreater@greenbee.net>
Newsgroups comp.lang.javascript
Subject Re: I need help with the following code.
Date 2014-07-18 18:07 +0100
Message-ID <180720141807596839%timstreater@greenbee.net> (permalink)
References <cb3a7a8c-b4b5-4cce-8184-ebfdaf9a9d8b@googlegroups.com>

Show all headers | View raw


In article <cb3a7a8c-b4b5-4cce-8184-ebfdaf9a9d8b@googlegroups.com>,
Iria Vasquez-Paez <iriavp@gmail.com> wrote:

> This is the code as it starts on Code Academy.com. I'd greatly appreciate
> help on this. 
> 
> var bool = true;
> 
> while(bool === true){
>     console.log("Less is more!");
>     bool = false;
> }
> 
> 
> You have to remove the equals signs. 
> 
> var bool = true;
> 
> while(bool = true){
>     console.log("Less is more!");
>     bool = false;
> }
> 
> 
> This is my solution that does't pass the editor. 
> 
> 
> var bool = true;
> while(bool) {
> console.log ("Less is more!";
> bool = false;
> }
> 
> 
> This solution is a problem with syntax. Other solutions cause my browser to
> crash. I need to solve this headache in order to move on. I have gone ahead
> but I am not progressing with this problem. I really need a solution. The
> above solution is a syntax problem. Thanks. 

Reading this I am puzzled as to what question you are asking. You have
3 sets of code, although it is unclear what problem has been set and by
whom.

First set of code looks like it will put one line of output to the
console, and could in fact be simplified down to one statement - the
console.log statement.

Second set of code looks like it will likely loop for ever, as you are
setting bool to true at the top of the while.

Third set will give a syntax error because you're missing a closing
paren after the double-quote.

What I've written may or may not be relevant or even true as I've not
run any of the code examples. But then you've not specified your
problem or what you're trying to do.

-- 
"I am enclosing two tickets to the first night of my new play; bring a
friend.... if you have one." - GB Shaw to Churchill "Cannot possibly
attend first night, will attend second...  if there is one." - Winston
Churchill, in response.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 09:39 -0700
  Re: I need help with the following code. Tim Streater <timstreater@greenbee.net> - 2014-07-18 18:07 +0100
  Re: I need help with the following code. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-18 19:14 +0200
    Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 10:28 -0700
      Re: I need help with the following code. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-18 19:51 +0200
        Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 11:24 -0700
          Re: I need help with the following code. Tim Streater <timstreater@greenbee.net> - 2014-07-18 20:06 +0100
            Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 12:27 -0700
              Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 12:47 -0700
              Re: I need help with the following code. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-07-18 21:30 +0100
                Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 14:41 -0700
                Re: I need help with the following code. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-07-18 23:28 +0100
                Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 16:54 -0700
                Re: I need help with the following code. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-07-19 01:57 +0100
                Re: I need help with the following code. Mike Duffy <md_002@videotron.ca> - 2014-07-18 21:29 -0400
                Re: I need help with the following code. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-07-19 03:00 +0100
                Re: I need help with the following code. Gene Wirchenko <genew@telus.net> - 2014-07-21 10:23 -0700
                Re: I need help with the following code. Tim Streater <timstreater@greenbee.net> - 2014-07-19 09:11 +0100
              Re: I need help with the following code. Tim Streater <timstreater@greenbee.net> - 2014-07-18 21:33 +0100
          Re: I need help with the following code. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-18 22:06 +0200
  Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 10:23 -0700
    Re: I need help with the following code. Tim Streater <timstreater@greenbee.net> - 2014-07-18 18:27 +0100
  Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-18 22:04 +0200
    Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-18 22:53 +0200
      Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-18 22:56 +0200
      Re: I need help with the following code. Tim Streater <timstreater@greenbee.net> - 2014-07-18 22:08 +0100
        Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-18 23:37 +0200
          Re: I need help with the following code. John Harris <niam@jghnorth.org.uk.invalid> - 2014-07-20 10:50 +0100
            Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-20 20:56 +0200
              Re: I need help with the following code. Tim Streater <timstreater@greenbee.net> - 2014-07-20 22:40 +0100
                Re: I need help with the following code. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-21 07:41 +0200
              Re: I need help with the following code. Scott Sauyet <scott.sauyet@gmail.com> - 2014-07-21 11:49 -0700
                Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-22 13:58 +0200
                Re: I need help with the following code. Scott Sauyet <scott.sauyet@gmail.com> - 2014-07-22 07:45 -0700
                Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-22 21:54 +0200
      Re: I need help with the following code. Iria Vasquez-Paez <iriavp@gmail.com> - 2014-07-18 14:42 -0700
        Re: I need help with the following code. danca <cyberdanny@tiscalinet.it> - 2014-07-19 00:00 +0200
          Re: I need help with the following code. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-07-18 23:42 +0100
  Re: I need help with the following code. Denis McMahon <denismfmcmahon@gmail.com> - 2014-07-18 21:12 +0000

csiph-web