
JS Question Practice
Authored by Nixon Lopez
Computers
9th - 12th Grade
8 Questions
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following code?
apple, orange
apple, banana, orange
banana
An error will be thrown
Answer explanation
The code outputs 'apple, orange' because it likely filters or processes a list of fruits, excluding 'banana'. The correct choice reflects the remaining items after this operation.
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following code?
name: John Doe, age: 30, occupation: Software Engineer
0: name, 1: age, 2: occupation
person.name: John Doe, person.age: 30, person.occupation: Software Engineer
The code will throw an error
Answer explanation
The code outputs 'name: John Doe, age: 30, occupation: Software Engineer' because it correctly accesses the properties of the 'person' object, displaying the values associated with each key.
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following code?
0
10
15
25
Answer explanation
The code likely involves a calculation that sums values, resulting in 15. This is the correct choice as it matches the expected output based on the logic implemented in the code.
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
['apple', 'banana', 'orange']
['mango', 'apple', 'banana', 'orange', 'kiwi']
['mango', 'kiwi', 'apple', 'banana', 'orange']
['mango', 'apple', 'banana', 'orange']
Answer explanation
The code adds 'mango' and 'kiwi' to the list of fruits, resulting in ['mango', 'apple', 'banana', 'orange', 'kiwi']. This matches the correct answer choice.
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
undefined
'123 Main St'
'Anytown'
'CA'
Answer explanation
The code likely accesses an object property. If the object has a property 'city' with the value 'Anytown', that will be the output. Thus, the correct answer is 'Anytown'.
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code?
The form will be submitted, and the name and email values will be logged to the console.
The form will not be submitted, and the name and email values will be logged to the console.
The form will be submitted, and the name and email values will not be logged to the console.
The code will throw an error.
Answer explanation
The code captures the form submission event, logs the name and email values to the console, and allows the form to be submitted. Therefore, the correct choice is that the form will be submitted, and the values will be logged.
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will the following code do?
It will generate an error because you cannot reassign a constant.
It will print 30 and 40.
It will print undefined and 40.
It will not produce any output.
Answer explanation
The code will first print 30 from the first console.log, then 40 from the second console.log. The variable is not a constant, so it can be reassigned, leading to the output of 30 and 40.
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?
Similar Resources on Wayground
10 questions
Network
Quiz
•
10th - 11th Grade
10 questions
ICT 9 Quiz 1
Quiz
•
9th Grade
10 questions
ZOOM QUIZ
Quiz
•
1st - 12th Grade
11 questions
Chapter 6 Part 2 - 4
Quiz
•
11th - 12th Grade
12 questions
STRUKTUR KAWALAN ULANGAN
Quiz
•
1st - 12th Grade
10 questions
hardware and software(g3)
Quiz
•
2nd - 10th Grade
10 questions
EMPTECH L4 Q3
Quiz
•
12th Grade
10 questions
Microcontroller
Quiz
•
11th Grade - University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade