pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/javascript-tutorial/bg.javascript.info/pull/13.patch

switch/1-rewrite-switch-if-else/solution.md index d3e397434..30c455932 100644 --- a/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/solution.md +++ b/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/solution.md @@ -1,20 +1,20 @@ -To precisely match the functionality of `switch`, the `if` must use a strict comparison `'==='`. +За да съвпаднат точно функционалностите на `switch`,`if` трябва да използва стриктно сравнение `'==='`. -For given strings though, a simple `'=='` works too. +За стрингове обаче, просто `'=='` също работи. ```js no-beautify if(browser == 'Edge') { - alert("You've got the Edge!"); + alert("Имаш Edge!"); } else if (browser == 'Chrome' || browser == 'Firefox' || browser == 'Safari' || browser == 'Opera') { - alert( 'Okay we support these browsers too' ); + alert( 'Окей, поддържаме тези браузъри също' ); } else { - alert( 'We hope that this page looks ok!' ); + alert( 'Надяваме се тази страница да изглежда ОК!' ); } ``` -Please note: the construct `browser == 'Chrome' || browser == 'Firefox' …` is split into multiple lines for better readability. +Забележка: конструкцията `browser == 'Chrome' || browser == 'Firefox' …` е разделена на няколко реда за по-добра четливост. -But the `switch` construct is still cleaner and more descriptive. +Но `switch` конструкцията е все още по-чиста и описателна. From a89992c3c3547fb2770afe95f252fdbbc20494ac Mon Sep 17 00:00:00 2001 From: jkrumov <50460847+jkrumov@users.noreply.github.com> Date: Tue, 3 Dec 2019 17:30:08 +0200 Subject: [PATCH 3/7] Update task.md --- .../13-switch/1-rewrite-switch-if-else/task.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md b/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md index f4dc0e5f1..a955ce492 100644 --- a/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md +++ b/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md @@ -2,25 +2,25 @@ importance: 5 --- -# Rewrite the "switch" into an "if" +# Пренапиши конструкцията от "switch" към "if" -Write the code using `if..else` which would correspond to the following `switch`: +Напиши кода използвайки `if..else` което ще кореспондира с `switch`: ```js switch (browser) { case 'Edge': - alert( "You've got the Edge!" ); + alert( "Имаш Edge!" ); break; case 'Chrome': case 'Firefox': case 'Safari': case 'Opera': - alert( 'Okay we support these browsers too' ); + alert( 'Окей, поддърваме тези браузъри също' ); break; default: - alert( 'We hope that this page looks ok!' ); + alert( 'Надяваме се тази страница да изглежда ОК!' ); } ``` From 7e9a986b7668980b19775150282d07d6158ffe1d Mon Sep 17 00:00:00 2001 From: jkrumov <50460847+jkrumov@users.noreply.github.com> Date: Tue, 3 Dec 2019 17:30:43 +0200 Subject: [PATCH 4/7] Update task.md --- 1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md b/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md index a955ce492..4c73b1fdf 100644 --- a/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md +++ b/1-js/02-first-steps/13-switch/1-rewrite-switch-if-else/task.md @@ -16,7 +16,7 @@ switch (browser) { case 'Firefox': case 'Safari': case 'Opera': - alert( 'Окей, поддърваме тези браузъри също' ); + alert( 'Окей, поддържаме тези браузъри също' ); break; default: From 75de7d1112ee28b0ead8d4624ffc7473996cce71 Mon Sep 17 00:00:00 2001 From: jkrumov <50460847+jkrumov@users.noreply.github.com> Date: Tue, 3 Dec 2019 17:37:57 +0200 Subject: [PATCH 5/7] Update solution.md --- .../13-switch/2-rewrite-if-switch/solution.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md b/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md index ed87dd94b..98243f5a1 100644 --- a/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md +++ b/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md @@ -1,4 +1,4 @@ -The first two checks turn into two `case`. The third check is split into two cases: +Първите две проверки се превръщат в два `case`. Третата проверка е разделена на два случая: ```js run let a = +prompt('a?', ''); @@ -21,6 +21,6 @@ switch (a) { } ``` -Please note: the `break` at the bottom is not required. But we put it to make the code future-proof. +Забележка: `break` на дъното е ненужен но ние го добавихме, за да направим кода пригоден и за вбъдеще. -In the future, there is a chance that we'd want to add one more `case`, for example `case 4`. And if we forget to add a break before it, at the end of `case 3`, there will be an error. So that's a kind of self-insurance. +В бъдеще, има шанс да искаме да добавим още `case`, например `case 4`. И ако забравим да добавим `break` преди това, в края на `case 3`, ще се появи грешка. Това е презастраховане. From c385f0bc27ee5935936428af772d0521830bd433 Mon Sep 17 00:00:00 2001 From: jkrumov <50460847+jkrumov@users.noreply.github.com> Date: Tue, 3 Dec 2019 17:38:13 +0200 Subject: [PATCH 6/7] Update solution.md --- 1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md b/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md index 98243f5a1..132e2ac7a 100644 --- a/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md +++ b/1-js/02-first-steps/13-switch/2-rewrite-if-switch/solution.md @@ -21,6 +21,6 @@ switch (a) { } ``` -Забележка: `break` на дъното е ненужен но ние го добавихме, за да направим кода пригоден и за вбъдеще. +Забележка: `break` на дъното е ненужен, но ние го добавихме, за да направим кода пригоден и за вбъдеще. В бъдеще, има шанс да искаме да добавим още `case`, например `case 4`. И ако забравим да добавим `break` преди това, в края на `case 3`, ще се появи грешка. Това е презастраховане. From 9ab58e76b93f423991d4baa2edb0412758b3da21 Mon Sep 17 00:00:00 2001 From: jkrumov <50460847+jkrumov@users.noreply.github.com> Date: Tue, 3 Dec 2019 17:40:28 +0200 Subject: [PATCH 7/7] Update task.md --- 1-js/02-first-steps/13-switch/2-rewrite-if-switch/task.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/02-first-steps/13-switch/2-rewrite-if-switch/task.md b/1-js/02-first-steps/13-switch/2-rewrite-if-switch/task.md index ec99d098d..57ac8c54c 100644 --- a/1-js/02-first-steps/13-switch/2-rewrite-if-switch/task.md +++ b/1-js/02-first-steps/13-switch/2-rewrite-if-switch/task.md @@ -2,9 +2,9 @@ importance: 4 --- -# Rewrite "if" into "switch" +# Пренапиши конструкцията от "if" към "switch" -Rewrite the code below using a single `switch` statement: +Пренапиши кода по-долу използвайки една единствена `switch` конструкция: ```js run let a = +prompt('a?', ''); pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy