Consider the following string:
const str = "I am a good boy"
At, index 7 = g At, indedx 10 = d But when I use, splice method for strings, which accept two parameters ie start index, end index, so when I use
const result = str.slice(7, 10)
console.log(result)
I am expecting it to return good but it only returns goo Why is that so, even at index 10, d is present?
According to W3 Schools
slice() extracts a part of a string and returns the extracted part in a new string.
The method takes 2 parameters: the starting index (position), and the ending index (position).

splice()orslice()?