Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Web technologies Questions | JavaScript Course Quiz 1 | Question 36

  • Last Updated : 26 Aug, 2021

What will be the output of the following code snippet
const str1=’GeeksforGeeks’
const str2=str1.slice(2,5)

(A) eks
(B) eksf
(C) Geek
(D) Geeksf

Answer: (A)

Explanation: The slice method is used to slice a string. Syntax: slice(startingindex, endIndex)

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!