#10 JavaScript Tutorial | Switch case

preview_player
Показать описание
You can use multiple if…else…if statements to perform a multiway branch. However, this is not always the best solution, especially when all of the branches depend on the value of a single variable. Starting with JavaScript 1.2, you can use a switch statement which handles exactly this situation, and it does so more efficiently than repeated if…else if statements.
The switch case statement in JavaScript is also used for decision making purposes. In some cases, using the switch case statement is seen to be more convenient over if-else statements. Consider a situation when we want to test a variable for hundred different values and based on the test we want to execute some task. Using if-else statement for this purpose will be less efficient over switch case statements and also it will make the code look messy.
Video by - Tanmay Sakpal
Рекомендации по теме
Комментарии
Автор

just an hour before i started this playlist. just awesome tutorial.loved it...

chinmayraut
Автор

Best explanation of default case. It used to be confusing till this video. You are awesome!

msms
Автор

I just like programming... But after watching these videos... I am sure I will eagerly learn whichever language u will teach... U r the best cs related teacher I hv got yet on YouTube...

riyatiwari
Автор

Everytime i watch your video first like than starts watching. That great u r.

SurajChauhan-tbpc
Автор

Soo Clear and perfect you saved me from ATKT in web programming bro thnx alot and very productive and accurate information thank you so much 🙏

karangurav
Автор

And one more thing you are fabulous ....and teaching methodology is also fabulous...

nirajkumarwebdesignerdevel
Автор

Good work man !! This is my first series on any programming language...which I started watching and it's still under work(i.e. you r still uploading new videos)...soon in I'm gonna be with Ur pace of jQuery😅😅...just don't skip any topic coz u r explaining really good with nice examples...!!

utkarshtyagi
Автор

information about switch case especially passing a conactenated string in switch...
keep going...

FazilKhan-vrsw
Автор

Awesome tutorials man thanks alot helped me on my programming journey

expertservicegroup
Автор

Thank you so much Tanmay . I feel like JavaScript is similar to java a little bit

bhavikakapadia
Автор

thanks buddy, it's very helpful for beginners and you makes it very easy
to understand

shivanigupta-jhqb
Автор

Bro I think We can use those strings, boolean values and expressions in java also

Nice video Bro uploading two videos in single day 👌👌👌

vineethkumar
Автор

This tutorial is awesome sir 🤟
But I have a question should I learn multiple languages or become perfect in Java script ?

nihal
Автор

very clean idea and super organized tutorial, thank you soooo

mdobaidulhaque
Автор

The only difference in JavaScript switch() statement and switch() statements in various other languages that I saw here is due to the JavaScript is loosely and dynamically typed language and many other languages that I studied e.g. C, C++, C#, Java etc. are strictly typed. It makes great differences between JavaScript and many other languages.

yt.user-zull
Автор

Why your statement of document.write changed after case 3 and please explain about it

altamashkhan
Автор

i really luv the way to deliver ...tyx u so much

rohankumarroy
Автор

Why did u write ln in case 3 after document. write

chagantisrichandana
Автор

Sir one big question or doubt why palindrome n other questions is asked during interview it is never used during projects..

EntertainmentTV-xgxr
Автор

Do we need to put curly braces inside the cases if there are multiple statements inside it??

zahabiyakharodawala