Skip to content

Commit 568dbf8

Browse files
committed
completed, still having trouble with last part of Array and String Conversion
1 parent 6ef896e commit 568dbf8

File tree

6,871 files changed

+757265
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,871 files changed

+757265
-8
lines changed

arrays/studio/array-string-conversion/array-testing.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ strings = [protoArray1, protoArray2, protoArray3, protoArray4];
88
//2)
99
function reverseCommas() {
1010
//TODO: 1. create and instantiate your variables.
11-
let check;
12-
let output;
11+
let check = strings[0];
12+
if (strings[0].includes(',')) {
13+
(strings[0].split(',').reverse().join(','))
14+
}
15+
let output = check.split(',').reverse().join(',') ;
1316
//TODO: 2. write the code required for this step
1417

1518
//NOTE: For the code to run properly, you must return your output. this needs to be the final line of code within the function's { }.
@@ -18,8 +21,12 @@ function reverseCommas() {
1821

1922
//3)
2023
function semiDash() {
21-
let check;
22-
let output;
24+
let check = strings[1];
25+
if (strings[1].includes(';')) {
26+
(strings[1].split(';').sort().join('-'))
27+
28+
}
29+
let output = check.split(';').sort().join('-');
2330
//TODO: write the code required for this step
2431

2532

@@ -28,17 +35,23 @@ function semiDash() {
2835

2936
//4)
3037
function reverseSpaces() {
31-
let check;
32-
let output;
38+
let check = strings[2];
39+
if (strings[2].includes(' ')) {
40+
(strings[2].split(' ').sort().reverse().join(' '))
41+
}
42+
let output = check.split(' ').sort().reverse().join(' ');
3343
//TODO: write the code required for this step
3444

3545
return output;
3646
}
3747

3848
//5)
3949
function commaSpace() {
40-
let check;
41-
let output;
50+
let check = strings[3] ;
51+
if (strings[3].includes(', ')) {
52+
(strings[3].split(',').reverse().join(','))
53+
}
54+
let output = check.split(',').reverse().join(',');
4255
//TODO: write the code required for this step
4356

4457
return output;

arrays/studio/array-string-conversion/node_modules/.bin/acorn

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/acorn.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/acorn.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/browserslist

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/browserslist.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/browserslist.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/create-jest

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/create-jest.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/create-jest.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/escodegen

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/escodegen.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/escodegen.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/esgenerate

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/esgenerate.cmd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/esgenerate.ps1

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

arrays/studio/array-string-conversion/node_modules/.bin/esparse

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)