Re: If value is in a list



Tom Cole wrote:
Just to toss another option out there...what about RegExp?

Is there a point in your repeating your suggestion ...

function doCheck(value, array) {
return (new RegExp('^(' + array.join('|') + ')$').test(value));
}

.... already made in
<news:c62a5dd5-58b6-4218-a4d9-30623c0c5bc2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>?

Send it the value to look for and the array of values...

See <news:480E6AB3.40300@xxxxxxxxxxxxxx>.

And please trim your quotes.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
.



Relevant Pages

  • Re: Simulate Mouse Event
    ... WFM in MSHTML, Gecko, Opera. ... And please trim your quotes. ... Anyone who slaps a 'this page is best viewed with Browser X' label on ...
    (comp.lang.javascript)
  • Re: TopPosting !!!!!!!!!!!!!!!!!!!!!!!!!!
    ... mailing list etiquette that specifically asks to bottom post, quote, ... and trim the quotes. ... Even better is when someone decides to hit reply to a previous mail to ... By top-posting they don't have to trim out crap. ...
    (Ubuntu)
  • Re: will the alerts displaying correctly?
    ... causing PHP to generate the wrong header value) ... or your browser is broken. ... Next time you do not trim your quotes as recommended, ...
    (comp.lang.javascript)
  • Re: PGP/GPG
    ... I do trim my quotes. ... Having someone sign a key doesn't force anyone else to trust ... Post validation at http://tinyurl.com/rv0y ...
    (comp.os.linux.misc)
  • Re: [SLE] (was: problems with clock) trimming quotes
    ... Patrick - My personal preference is to trim quotes. ... subscribe to 35 or 40 lists and am List Owner of 3. ... threading based on responses to a particular message, ... So, if trimming quotes is "de rigeur" on this list, I'll gladly trim. ...
    (SuSE)