Complete the code to print a message in the browser console.
console.[1]('Hello, JavaScript!');
The console.log method is used to print messages to the browser console.
Complete the code to create a variable named 'name' with the value 'Alice'.
let [1] = 'Alice';
The variable name should be name as specified.
Fix the error in the function declaration to correctly greet a user.
function greet([1]) { return `Hello, ${name}!`; }
The parameter name should be name to match the template literal inside the function.
Fill both blanks to create an array of numbers and get its length.
const numbers = [[1]]; const length = numbers.[2];
The array contains numbers separated by commas. The property to get the number of elements is length.
Fill all three blanks to create an object with a method that returns a greeting.
const person = {
[1]: 'Bob',
[2]() {
return `Hi, I am ${this.[3]`;
}
};The object has a property name, a method greet, and inside the method it uses this.name to access the property.