JavaScript Fundamentals

Quiz
•
Computers
•
8th Grade
•
Hard
harshit shukla
Used 6+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is not a valid primitive data type in JavaScript?
Number
String
Object
Boolean
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct way to declare an empty array in JavaScript?
var myArray = {};
var myArray = [];
var myArray = new Array();
Both b and c are correct
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
function greet(name) {
console.log("Hello, " + name + "!");
}
greet("Alice");
Hello, Alice!
function greet(name) {...}
undefined
Error
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which method is used to access a specific element in an array by its index?
getElementsByIndex
getElementAt
charAt ✅
None of the above
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How would you retrieve a reference to an HTML element with the ID "myElement" using JavaScript?
document.getElementByID("myElement");
document.getElementById("myElement");
document.querySelectorAll("#myElement");
document.getElementsByClassName("myElement");
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the difference between .innerHTML and .innerText?
.innerHTML includes HTML tags, while .innerText does not
.innerText includes HTML tags, while .innerHTML does not
There is no difference between them
.innerHTML is used for setting content, while .innerText is used for getting content
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which method is used to get the value of an attribute of an HTML element?
getAttribute()
getElementAttribute()
getAttributeValue()
None of the above
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
HTML Tags

Quiz
•
6th - 8th Grade
15 questions
Excel

Quiz
•
8th Grade
10 questions
HTML Basics

Quiz
•
7th - 10th Grade
16 questions
HTML TEST

Quiz
•
8th Grade
13 questions
A words - GCSE Computer Science

Quiz
•
1st - 10th Grade
15 questions
Representing Images

Quiz
•
8th - 10th Grade
10 questions
Programming - Arrays

Quiz
•
2nd - 12th Grade
20 questions
Advanced Excel

Quiz
•
KG - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade