Printing a message to the console: Copy code console.log(‘Hello, world!’); Declaring a variable and assigning it a value: Copy code var x = 10; Declaring a function: Copy code function greet(name) { console.log(‘Hello, ‘ + name + ‘!’); } Using an if statement to control the flow of execution: Copy code if (x > 5) { console.log(‘x…