main.js
×
styles.css
×
index.html
×
xxxxxxxxxx
1
xxxxxxxxxx
xxxxxxxxxx
// JavaScript Code Output Example const greeting = "Hello, World!"; console.log(greeting); // Sample function function add(a, b) { return a + b; } // Testing the function const result = add(5, 3); console.log(`5 + 3 = ${result}`); // Array operations const numbers = [1, 2, 3, 4, 5]; const doubled = numbers.map(num => num * 2); console.log("Doubled array:", doubled); // Object example const user = { name: "John", age: 30, sayHi() { console.log(`Hi, I'm ${this.name}`); } }; user.sayHi();