• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Troubleshooting

Why is my switch statement failing to execute any case statement?

Remember, switch comparisons use strict equality. Are you sure your test value and case value are of the same datatype? If you’re using a variable as a test value, an error may have caused your test value to be undefined. As a debugging measure, use the typeof operator to confirm the datatype of your test value just prior to the switch statement.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint