diff --git a/test.js b/test.js new file mode 100644 index 0000000..e0d30c3 --- /dev/null +++ b/test.js @@ -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)