Search Header Logo

JavaScript Strings

Authored by Mark Galesi

Computers

9th Grade

Used 15+ times

JavaScript Strings
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

var len = "jump it!".length;


What is the value of len?

8

7

9

6

This code does not compile.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

var x = "quarantine".indexOf("a");


What is the value of x?

4

3

2

This code does not compile.

StringIndexOutOfBoundsException

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

var s = "whatever".substring(1,4);


What is the value of s?

"hate"

"hat"

"whate"

"what"

StringIndexOutOfBoundsException

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

var p = "Go Paw Patrol!".indexOf("p");


What is the value of p? (Case matters)

0

4

3

-1

This code will not compile.

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

var s = "cool cat".substring(6,"cool cat".length);


What is the value of s?

"cat"

"at"

"cool c"

This code does not compile.

StringIndexOutOfBoundsException

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

var s = "good job".substring(3, 9);


What is the value of s?

"d job"

"od job"

"d jo"

"od jo"

StringIndexOutOfBoundsException

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which type of value is returned from the length function?

decimal

word

integer

true/false

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?