File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function capitalise(str) {
99 return str ;
1010}
1111
12- // the input "sty " is the same as output "str" which is not allowed in JS
12+ // the input "str " is the same as output "str" which is not allowed in JS
1313// my new code:
1414
1515function capitalise ( str ) {
Original file line number Diff line number Diff line change @@ -14,12 +14,11 @@ function convertToPercentage(decimalNumber) {
1414
1515console . log ( decimalNumber ) ;
1616
17- // =============> const decimalNumber =0.5 is wrong because we can not redeclare parameter using const inside function.
17+ // const decimalNumber =0.5 is wrong because we can not redeclare parameter using const inside function.
1818// what is more, decimalNumber is not defined in the global scope so we can not use console.log(decimalNumber)
1919
2020
21- // Finally, correct the code to fix the problem
22- // =============>
21+ // correct the code to fix the problem
2322function convertToPercentage ( decimalNumber ) {
2423 const percentage = `${ decimalNumber * 100 } %` ;
2524 return percentage ;
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ function square(3) {
1717// Finally, correct the code to fix the problem
1818
1919// =============>
20- function square ( num ) { return num * num } ;
20+ function square ( num ) {
21+ return num * num
22+ } ;
2123
2224console . log ( square ( 3 ) ) ;
2325
You can’t perform that action at this time.
0 commit comments