Case statement in JS

Results 1 to 3 of 3

Thread: Case statement in JS

  1. #1
    Cam Epp Guest

    Default Case statement in JS

    I am wondering if there is a case statement in J/JavaScript and what the syntax for it is. I have looked at a lot of online manuals and they haven&#039t mentioned if it&#039s there or not.

  2. #2
    Join Date
    Dec 1969

    Default RE: Case statement in JS

    I don&#039t know if there is one for JavaScript, but I do know that there IS one for JScript. The syntax is as follows:<BR><BR>switch (value){<BR> case "some string":<BR> statements;<BR> statements;<BR> break; // unless you want to drop on down to the next one<BR> case 10: // a number<BR> . . .<BR> break;<BR> default:<BR> . . .<BR>}<BR>

  3. #3
    Cam Epp Guest

    Default RE: Case statement in JS

    Thank you very much, that&#039s exactly what I needed :)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts