Can Switch case be used for String in JavaScript?

JavaScript has both. In a switch statement, the comparison with the cases is via === , and a string instance is not === to a string primitive. …that will turn it back into a primitive, whereupon your switch works.16 Şub 2013

Sizin İçin Seçtik  What is As_view () in Django?

Leave a Reply

Your email address will not be published. Required fields are marked *