@@ -34,13 +34,11 @@ Write a function that:
3434- numbers greater 100 must be replaced with 100
3535*/
3636
37- function formatPercentage ( arr ) {
38-
39- }
37+ function formatPercentage ( arr ) { }
4038
4139/* ======= TESTS - DO NOT MODIFY ===== */
4240
43- const util = require ( ' util' ) ;
41+ const util = require ( " util" ) ;
4442
4543function test ( test_name , actual , expected ) {
4644 let status ;
@@ -55,7 +53,9 @@ function test(test_name, actual, expected) {
5553 if ( isEqual ) {
5654 status = "PASSED" ;
5755 } else {
58- status = `FAILED: expected: ${ util . inspect ( expected ) } but your function returned: ${ util . inspect ( actual ) } ` ;
56+ status = `FAILED: expected: ${ util . inspect (
57+ expected
58+ ) } but your function returned: ${ util . inspect ( actual ) } `;
5959 }
6060
6161 console . log ( `${ test_name } : ${ status } ` ) ;
@@ -75,12 +75,8 @@ function arraysEqual(a, b) {
7575
7676test (
7777 "tidyUpString function works - case 1" ,
78- tidyUpString ( [ "/Daniel " , "irina " , " Gordon" , "ashleigh " ] ) , [
79- "daniel" ,
80- "irina" ,
81- "gordon" ,
82- "ashleigh"
83- ]
78+ tidyUpString ( [ "/Daniel " , "irina " , " Gordon" , "ashleigh " ] ) ,
79+ [ "daniel" , "irina" , "gordon" , "ashleigh" ]
8480) ;
8581test (
8682 "tidyUpString function works - case 2" ,
@@ -94,28 +90,20 @@ test("validate function works - case 3", validate(17), false);
9490test ( "validate function works - case 4" , validate ( "Ten" ) , false ) ;
9591test ( "validate function works - case 5" , validate ( 108 ) , false ) ;
9692
97- test (
98- "remove function works - case 1" ,
99- remove ( [ 10 , 293 , 292 , 176 , 29 ] , 3 ) , [ 10 , 293 , 292 , 29 ]
100- ) ;
93+ test ( "remove function works - case 1" , remove ( [ 10 , 293 , 292 , 176 , 29 ] , 3 ) , [
94+ 10 ,
95+ 293 ,
96+ 292 ,
97+ 29 ,
98+ ] ) ;
10199test (
102100 "remove function works - case 2" ,
103- remove ( [ "a" , "b" , "c" , "d" , "e" , "f" , "g" ] , 6 ) , [
104- "a" ,
105- "b" ,
106- "c" ,
107- "d" ,
108- "e" ,
109- "f"
110- ]
101+ remove ( [ "a" , "b" , "c" , "d" , "e" , "f" , "g" ] , 6 ) ,
102+ [ "a" , "b" , "c" , "d" , "e" , "f" ]
111103) ;
112104
113105test (
114106 "formatPercentage function works - case 1" ,
115- formatPercentage ( [ 23 , 18.103 , 187.2 , 0.372 ] ) , [
116- "23%" ,
117- "18.1%" ,
118- "100%" ,
119- "0.37%"
120- ]
107+ formatPercentage ( [ 23 , 18.103 , 187.2 , 0.372 ] ) ,
108+ [ "23%" , "18.1%" , "100%" , "0.37%" ]
121109) ;
0 commit comments