/6 Javascript Basic Test your JavaScript Language Skills. 1 / 6 1) How do you write a single-line comment in JavaScript? A) <!-- This is a comment --> B) // This is a comment C) ** This is a comment D) /* This is a comment */ 2 / 6 2) What is the correct syntax to print a message in the console? A) console.print("Hello World"); B) console.log("Hello World"); C) log.console("Hello World"); D) print.console("Hello World"); 3 / 6 3) Which of the following is not a valid JavaScript data type? A) Number B) String C) Character D) Boolean 4 / 6 4) Which of the following is the correct way to declare a constant in JavaScript? A) let PI = 3.14; B) constant PI = 3.14; C) const PI = 3.14; D) var PI = 3.14; 5 / 6 5) Which of the following is a correct way to declare a variable in JavaScript? A) var myVariable; B) variable myVariable; C) v myVariable; D) myVariable var; 6 / 6 6) How do you create a function in JavaScript? A) function = myFunction() {} B) function myFunction() {} C) create function myFunction() {} D) function () {} 0% Restart quiz