Skip to content

Commit 47250b6

Browse files
committed
modified: functions/studio/studio-functions.js
1 parent 95c9cd4 commit 47250b6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

functions/studio/studio-functions.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
// 6. Optional: Use method chaining to reduce the lines of code within the function.
1111

1212
function reverseCharacters(str) {
13-
return str.split("").reverse().join("");
14-
}
13+
return str.split("").reverse().join("");
14+
}
1515

1616
let word = "apple";
1717

1818
console.log(reverseCharacters(word));
1919

20-
2120
// Part Two: Reverse Digits
2221

2322
// 1. Add an if statement to reverseCharacters to check the typeof the parameter.
@@ -47,9 +46,9 @@ console.log(reverseCharacters2(num));
4746
// 5. Return the final, reversed array.
4847
// 6. Be sure to print the results from each test case in order to verify your code.
4948

50-
let arrayTest1 = ['apple', 'potato', 'Capitalized Words'];
49+
let arrayTest1 = ["apple", "potato", "Capitalized Words"];
5150
let arrayTest2 = [123, 8897, 42, 1168, 8675309];
52-
let arrayTest3 = ['hello', 'world', 123, 'orange'];
51+
let arrayTest3 = ["hello", "world", 123, "orange"];
5352

5453
function reverseArray(arr) {
5554
return arr.reverse().map((e) => {
@@ -59,7 +58,6 @@ function reverseArray(arr) {
5958

6059
console.log(reverseArray(arrayTest3));
6160

62-
6361
// Bonus Missions
6462

6563
// 1. Have a clear, descriptive name like funPhrase.

0 commit comments

Comments
 (0)