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


Groups > comp.lang.javascript > #32520

Re: Values of statements

Newsgroups comp.lang.javascript
Subject Re: Values of statements
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <statement-20170205003911@ram.dialup.fu-berlin.de> <6obh9ctgdokncr59hskac44e2p47k776tq@4ax.com>
Date 2017-02-06 23:35 +0100
Message-ID <XnsA714F00C61BAAeejj99@194.109.6.166> (permalink)

Show all headers | View raw


Gene Wirchenko <genew@telus.net> wrote on 06 Feb 2017 in 
comp.lang.javascript:

> Replace the return with:
> 
>           if (a===0)
>              return 'Null';
>           else
>              if (a===1)
>                 return 'Eins';
>              else 
>                 return 'Zwei';
> 

If a can only be 0,1,2 try the better looking:

return ['Null','Eins','Zwei'][a];




-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


Thread

Re: Values of statements Gene Wirchenko <genew@telus.net> - 2017-02-06 09:16 -0800
  Re: Values of statements "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-06 23:35 +0100

csiph-web