adplus-dvertising
frame-decoration

Question

Which of the following returns the first characters of the string str?

a.

str.charAt(0);

b.

str.substring(1);

c.

str.charAt(1);

d.

str.charAt(2);

Answer: (a).str.charAt(0);

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following returns the first characters of the string str?

Similar Questions

Discover Related MCQs

Q. Which method is used to search for a sub string?

Q. What is the full form of DOM?

Q. Which of the following refers to the <html> element in an HTML document?

Q. Which of the following objects is the root object in HTML DOM object hierarchy?

Q. Which of the following is not a property of the window object?

Q. Which of the following is not a method of the window object?

Q. What does the confirm() method of the window object return?

Q. Which of the following methods executes a certain piece of code after a periodic interval?

Q. Which of the following is not a property of the location object?

Q. Which of the following is a method of the location object?

Q. Which of the following is not a property of the history object?

Q. Which of the following is not a method of the history object?

Q. Which of the following refers to the <body> element in an HTML page?

Q. Which of the following represents the <head> element?

Q. Which of the following is not a mouse event?

Q. The event object is accessible from

Q. Which of the following is not a property of the event object?

Q. How many phases are there in the W3C event propagation model?

Q. Which of the following methods on an element node is used to check whether it has any child nodes?

Q. Which of the following returns a reference of an element having the id “panel”?