Search Header Logo

Javascript Array and Object

Authored by Trung Quang

Computers

University - Professional Development

Used 21+ times

Javascript Array and Object
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Given a number of elements that need to stay in order, would you use an Object or an Array?

Object

Array

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Given a collection of artists and lists of their songs, would you store the artist-song-list pairs in an Object or an Array?

Object

Array

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

All the elements in an array must be of the same type.

True

False

4.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

All keys in an object are strings.

True

False

Answer explanation

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What happens to the array in the following code snippet?

const dogs = ["Fido", "Odie", "Oscar"];

dogs.length;

dogs.length = 1;

dogs; // What will the array contain here?

Nothing

The array becomes just ["Oscar"]

The array becomes just ["Fido"]

The array becomes just ["Odie", "Oscar"]

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What are the keys in the object after running the code below?

['Prince', 'The Beatles', 'Joni Mitchell', 'Justin Bieber', 'Daft Punk']

['Prince', 'The Beatles', 'Joni Mitchell', 'Justin Bieber']

['Prince', 'The Beatles', 'Joni Mitchell']

['Prince', 'The Beatles', 'Joni Mitchell', 'Daft Punk']

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

If we run artistsAndSongs['Daft Punk'].push("Around the World") after running the code below, what is the value of the object?

Media Image
Media Image
Media Image
Media Image

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers