Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
-4
rated 0 times [  0] [ 4]  / answers: 1 / hits: 18227  / 12 Years ago, tue, january 8, 2013, 12:00:00

Possible Duplicate:

JavaScript or-expression in a switch case






case 'att':
window.location.replace('/att-Forms.htm');
break;
case 'at&t':
window.location.replace('/att-Forms.htm');
break;


is there a way to shorten this with some kind of or function?


More From » case

 Answers
46

Combine the cases



case 'att':
case 'at&t':
window.location.replace('/att-Forms.htm');
break;

[#81002] Monday, January 7, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
pierre

Total Points: 716
Total Questions: 128
Total Answers: 102

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
pierre questions
Fri, Nov 6, 20, 00:00, 4 Years ago
Fri, Sep 4, 20, 00:00, 4 Years ago
Thu, Jul 18, 19, 00:00, 5 Years ago
Sun, Dec 2, 18, 00:00, 6 Years ago
Fri, Oct 26, 18, 00:00, 6 Years ago
;