Skip to content

Commit 70ef111

Browse files
committed
practicing
1 parent 1056db8 commit 70ef111

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Sprint-2/1-key-errors/0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

1515
function capitalise(str) {

Sprint-2/1-key-errors/1.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ function convertToPercentage(decimalNumber) {
1414

1515
console.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
2322
function convertToPercentage(decimalNumber) {
2423
const percentage = `${decimalNumber * 100}%`;
2524
return percentage;

Sprint-2/1-key-errors/2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

2224
console.log (square(3));
2325

0 commit comments

Comments
 (0)