
Frontend Quiz-6 Summer internship
Authored by Gnaneshwar Reddy
Other
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to create a JavaScript object?
A) var obj = {};
B) var obj = ();
C) var obj = [];
D) var obj = {};
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you add a property to an existing JavaScript object?
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to select an element by its ID in the DOM?
A) document.querySelector("#id");
B) document.getElementById("id");
C)
document.getElementsByClassName("id");
D) document.getElementByTagName("id");
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax for an if statement in JavaScript?
A) if (condition) {}
B) if condition {}
C) if [condition] {}
D) if {condition} {}
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the "switch" statement do in JavaScript?
A) Iterates over a collection
B) Switches the value of a variable
C) Evaluates an expression and matches the value to a case clause
D) Changes the value of a variable based on its type
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to create a new HTML element in the DOM?
A) document.createElement("tagName");
B) document.newElement("tagName");
C) document.buildElement("tagName");
D) document.addElement("tagName");
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you check if an object has a specific property?
A) object.hasProperty("property");
B) object.contains("property");
C) object.hasOwnProperty("property");
D) object.include("property");
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?