Welcome to the JavaScript coding tutorial! Below, you'll find examples of code, program output, and helpful keyboard shortcuts.
function greet(name) {
console.log("Hello, " + name);
}
greet("World");
The above code defines a function that takes a name as an argument and prints a greeting message to the console.
To run the code in your browser console, press Ctrl + Shift + J (Windows/Linux) or Cmd + Option + J (Mac).
When you run the code, the following output will appear:
Hello, World