vendredi 22 mai 2020

indexOf('a') and lastIndexOf('') in javascript returning same value for a word. "William" [closed]

indexOf('a') and lastIndexOd('a') for the string 'william' returns 5 for both while for the character 'l' it works fine.

Screenshots:-

This the input for JS This is the output

But for the character 'l' it works like normal.

For the character 'l' Output for character 'l'




Aucun commentaire:

Enregistrer un commentaire