File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
1-js/02-first-steps/13-switch/1-rewrite-switch-if-else Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- To precisely match the functionality of ` switch ` , the ` if ` must use a strict comparison ` '===' ` .
1+ Tam, kad būtų palaikomas ` switch ` funkcionalumas ` if ` turi naudoti griežtą lygybę ` '===' ` .
22
3- For given strings though, a simple ` '==' ` works too .
3+ Bet duotoms eilutėms, paprasta lygybė ` '==' ` taip pat veikia .
44
55``` js no-beautify
66if (browser == ' Edge' ) {
7- alert (" You've got the Edge!" );
7+ alert (" Jūs turite Edge!" );
88} else if (browser == ' Chrome'
99 || browser == ' Firefox'
1010 || browser == ' Safari'
1111 || browser == ' Opera' ) {
12- alert ( ' Okay we support these browsers too ' );
12+ alert ( ' Gerai, palaikome ir tokias naršykles ' );
1313} else {
14- alert ( ' We hope that this page looks ok !' );
14+ alert ( ' Mes tikimės, kad šis puslapis veikia gerai !' );
1515}
1616```
1717
18- Please note: the construct ` browser == 'Chrome' || browser == 'Firefox' … ` is split into multiple lines for better readability .
18+ Atkreipkite dėmesį: konstruktas ` browser == 'Chrome' || browser == 'Firefox' … ` yra atskirtas į naujas eiles dėl geresnio skaitomumo .
1919
20- But the ` switch ` construct is still cleaner and more descriptive .
20+ Tačiau ` switch ` vis tiek yra švaresnis ir labiau apibūdinantis konstruktas .
You can’t perform that action at this time.
0 commit comments