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

Показать описание
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
#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