
KA JS Objects
Computers
KG - University
Used 73+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is a valid line of JS code that stores an object in a variable?
var me = {age=31, hair='brown'};
var me = {age: 31, hair: 'brown'};
var me = {age:31 hair:'brown'};
var me = {var age=31, var hair='brown'};
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these objects have 3 properties?
var me = {age: 31, hair: 'brown'};
var me = {age: 31};
var me = {age: 31, hair: 'brown', eyes: 'blue'};
var me = {hair: ['brown', 'blonde', 'pink']};
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Let's say you're storing an object in a variable named 'angel' with the property 'fur'. Which line of code would change that property's value?
angel.fur = 'orange';
angel[fur] = 'orange';
angel_fur = 'orange';
var angel.fur = 'orange';
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Let's say you're storing an object in a variable named 'pumpkin'. Which line of code would add a new property 'eyes' to the object?
pumpkin.push({eyes: 'green'});
pumpkin[eyes] = 'green';
pumpkin.eyes = 'green';
var pumpkin.eyes = 'green'
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does JavaScript return to you if you try to access a object's property that doesn't exist?
null
undefined
'oopsies!'
0
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these is a valid line of JS that stores an array of objects in a variable?
var books = [{title: 'Robot Dreams', author: 'Asimov'}];
var books = [{title='Robot Dreams', author='Asimov'}];
var books = {[title: 'Robot Dreams', author: 'Asimov']};
var books = [title: 'Robot Dreams', author: 'Asimov'];
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?