JavaScript Coding Tutorial

Welcome to the JavaScript coding tutorial! Below, you'll find examples of code, program output, and helpful keyboard shortcuts.

Example: Greeting Function


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.

Keyboard Shortcut

To run the code in your browser console, press Ctrl + Shift + J (Windows/Linux) or Cmd + Option + J (Mac).

Expected Output

When you run the code, the following output will appear:

Hello, World