Skip to content

Commit 1552743

Browse files
committed
Add explanation for potential SyntaxError in convertToPercentage function
1 parent c094e79 commit 1552743

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • Sprint-3/1-key-errors

‎Sprint-3/1-key-errors/1.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33

44
// Why will an error occur when this program runs?
55
// =============> write your prediction here
6+
//An error will occur because 'const decimalNumber = 0.5' clashes with the parameter of the same name.
67

78
// Try playing computer with the example to work out what is going on
89

910
function convertToPercentage(decimalNumber) {
11+
//
1012
const decimalNumber = 0.5;
1113
const percentage = `${decimalNumber * 100}%`;
1214

0 commit comments

Comments
 (0)