Skip to content

Commit 70568c2

Browse files
committed
array studio
1 parent b48c3fe commit 70568c2

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,29 @@ let protoArray3 = "space delimited string";
44
let protoArray4 = "Comma-spaces, might, require, typing, caution";
55

66
strings = [protoArray1, protoArray2, protoArray3, protoArray4];
7-
console.log(protoArray1.includes(" "));
7+
88
//2)
99
function reverseCommas() {
1010
//TODO: 1. create and instantiate your variables.
11-
//let check;
11+
let check;
1212
let output = protoArray1.split(",").reverse().join(",");
1313
//TODO: 2. write the code required for this step
14-
1514
//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 { }.
1615
return output;
1716
}
1817

1918
//3)
2019
function semiDash() {
2120
let check;
22-
let output;
21+
let output = protoArray2.split(";").sort().join("-");
2322
//TODO: write the code required for this step
24-
25-
2623
return output;
2724
}
2825

2926
//4)
3027
function reverseSpaces() {
3128
let check;
32-
let output;
29+
let output = protoArray3.split(" ").sort().reverse().join(" ");
3330
//TODO: write the code required for this step
3431

3532
return output;
@@ -38,7 +35,7 @@ function reverseSpaces() {
3835
//5)
3936
function commaSpace() {
4037
let check;
41-
let output;
38+
let output = protoArray4.split(", ").reverse().join(", ");
4239
//TODO: write the code required for this step
4340

4441
return output;
@@ -51,4 +48,4 @@ module.exports = {
5148
semiDash: semiDash,
5249
reverseSpaces : reverseSpaces,
5350
commaSpace : commaSpace
54-
};
51+
};

0 commit comments

Comments
 (0)