Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Example JavaScript program with intentional errors

// Error 1: Missing semicolon
let greeting = "Hello, World!"
console.log(greeting)

// Error 2: Undefined variable
console.log(someUndefinedVariable)

// Error 3: Invalid function call
function sayHello(name) {
console.log("Hello, " + name)
}

sayHello("Alice")

// Error 4: Using const and trying to reassign a value
const number = 42
number = 100

// Error 5: Typo in the variable name
let message = "This is a message"
console.log(mesage)