includes (): returns a Boolean value that indicates whether to find a parameter string. startsWith (): returns a Boolean value indicating whether the parameter string at the head of the original string. endsWith (): returns a Boolean value indicating whether the parameter string at the end of the original string. S the let = 'the Hello World!' ; s.startswith ( 'the Hello') // to true s.endsWith ( '!') // to true s.includes ( 'O') // to true
endsWith
The behavior of the other two methods are different. It is for the previous n
characters, while the other two methods for from the first n
end position until a string