Can the indexOf() method be used on strings as well as arrays? #javascript

preview_player
Показать описание
Can the indexOf() method be used on strings as well as arrays?
#javascript #string #array #index

***SAMPLE FUNCTION:
function indexOfMethod() {
let string = 'hello'
let array = ['a','b','c']

// output: 1
// output: 0

/* indexOf() can be used on both */
}

#Shorts #youtubeShorts #trending #viral #quicktips #youtube #youtuber #Shortstiktok
Рекомендации по теме
join shbcf.ru