Skip to content

Commit f2538a4

Browse files
authored
Update 24-debugging.md
1 parent 335d971 commit f2538a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

notes/English/24-debugging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ In this example, the code is trying to access the variable x without first decla
138138
These occur when the code is trying to perform an operation on a variable of the wrong type. Examples include trying to use a string as a number, or trying to access a property of a non-object.
139139

140140
```
141-
var x = "hello";
142-
x = x + 3;
141+
var x = 7;
142+
console.log(x.toUpperCase());
143143
```
144144

145-
In this example, the code is trying to add the number 3 to the string "hello", but strings and numbers are different data types and cannot be directly combined. This will cause a type error, and the code will not execute.
145+
In this example, the code is trying to convert number 7 to uppercase. This will cause a type error, and the code will not execute.
146146

147147
#### Range errors
148148

0 commit comments

Comments
 (0)