Back to Demos
Diff Checker
Compare two pieces of text and see the differences highlighted line by line.
Removed: 3Added: 4Unchanged: 3
Original
Modified
Comparison Result
| 1 | − | function greet(name) { | |
| 2 | − | console.log("Hello, " + name); | |
| 1 | + | function greet(name, greeting = "Hello") { | |
| 2 | + | console.log(greeting + ", " + name + "!"); | |
| 3 | 3 | return true; | |
| 4 | 4 | } | |
| 5 | 5 | ||
| 6 | − | greet("World"); | |
| 6 | + | // Call the function | |
| 7 | + | greet("World", "Hi"); |