Skip to content

Commit a070e4c

Browse files
authored
Create test.js
1 parent fab0de0 commit a070e4c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Example JavaScript program with intentional errors
2+
3+
// Error 1: Missing semicolon
4+
let greeting = "Hello, World!"
5+
console.log(greeting)
6+
7+
// Error 2: Undefined variable
8+
console.log(someUndefinedVariable)
9+
10+
// Error 3: Invalid function call
11+
function sayHello(name) {
12+
console.log("Hello, " + name)
13+
}
14+
15+
sayHello("Alice")
16+
17+
// Error 4: Using const and trying to reassign a value
18+
const number = 42
19+
number = 100
20+
21+
// Error 5: Typo in the variable name
22+
let message = "This is a message"
23+
console.log(mesage)

0 commit comments

Comments
 (0)