You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5 lines
248 B
5 lines
248 B
5 years ago
|
// search: it takes a substring as an argument and it returns the index of the first match.
|
||
|
// string.search(substring)
|
||
|
let string = 'I love JavaScript. If you do not love JavaScript what else can you love.'
|
||
|
console.log(string.search('love')) // 2
|