mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-02 11:07:15 -05:00
fix(curriculum): add switch statement spaces for consistency (#46141)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -13,7 +13,7 @@ If the `break` statement is omitted from a `switch` statement's `case`, the foll
|
||||
|
||||
```js
|
||||
let result = "";
|
||||
switch(val) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
@@ -127,7 +127,7 @@ sequentialSizes(1);
|
||||
function sequentialSizes(val) {
|
||||
let answer = "";
|
||||
|
||||
switch(val) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
|
||||
@@ -24,7 +24,7 @@ if (val === 1) {
|
||||
can be replaced with:
|
||||
|
||||
```js
|
||||
switch(val) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
answer = "a";
|
||||
break;
|
||||
@@ -136,7 +136,7 @@ chainToSwitch(7);
|
||||
function chainToSwitch(val) {
|
||||
let answer = "";
|
||||
|
||||
switch(val) {
|
||||
switch (val) {
|
||||
case "bob":
|
||||
answer = "Marley";
|
||||
break;
|
||||
|
||||
@@ -14,7 +14,7 @@ If you have many options to choose from, use a <dfn>switch</dfn> statement. A `s
|
||||
Here is an example of a `switch` statement:
|
||||
|
||||
```js
|
||||
switch(lowercaseLetter) {
|
||||
switch (lowercaseLetter) {
|
||||
case "a":
|
||||
console.log("A");
|
||||
break;
|
||||
@@ -96,7 +96,7 @@ caseInSwitch(1);
|
||||
function caseInSwitch(val) {
|
||||
let answer = "";
|
||||
|
||||
switch(val) {
|
||||
switch (val) {
|
||||
case 1:
|
||||
answer = "alpha";
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user