Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback on: irt.org FAQ Knowledge Base Q1618, May 01, 2001 at 13:27:59:

You are here: irt.org | About | Feedback | 2680 [ previous next ]

Feedback on:
irt.org FAQ Knowledge Base Q1618

Sent by
Alex Vincent on May 01, 2001 at 13:27:59:

Worth:
Worth reading

Comments:
Found a better way to make switch statements apply for ranges.

var x = 2
switch (true) {
case (1 > x):
alert("1 > x")
break;

case ((1 < x)&&(x < 3)):
alert("Pass")
break;

case (x > 3):
alert("x > 3")
break;

default:
alert("Oh boy")
}

8-D


Other feedback on 'irt.org FAQ Knowledge Base Q1618' - show all

©2018 Martin Webb