References
String.lastIndexOf()
Leírás
Visszatér a String példány azon indexével, ahol utoljára fordul elő (kezdődik) az argumentumba írt string.
Szintaxis
lastIndexOf(searchString)
lastIndexOf(searchString, position)
Példa
const paragraph1 = 'Javascript'
console.log(paragraph1.lastIndexOf('s'))
// Expected output: 4
const paragraph2 = 'TechOnTheNet'
console.log(paragraph2.lastIndexOf('T', 4))
// Expected output: 0