Question: Based on the following code fragment, for extracting the word know from the sentence, what are the values of x and y respectively? var a

Based on the following code fragment, for extracting the word "know" from the sentence, what are the values of x and y respectively?
var a = "You know the rules and so do I!";
var result = a.substring(x, y);
alert(result);
A.
x=4, y=7
B.
x=4, y=8
C.
x=5, y=8
D.
x=5, y=9

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!