Select 1 value from multiple...
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Select 1 value from multiple...

From: Noozer <dont.spam@me.here>
Date: Wed Aug 10 2005 - 10:49:35 CEST

I want to return one of several values, based on the value of a variable.

Is there a compact way to write this? Something like:

var J=5;
var K= {"One","Two","Three","Four","Five","Six"} [J] ;

... so K would hold "Five" in this case.

Thx
Received on Mon Oct 24 02:13:59 2005