0

How to use Regular Expression to return the string of an array element that contains the word "Netflix"

Here is what I tried:

const arr = [
    'Sweet TV - some description',
    'MEGOGO - some description.',
    'Netflix - some description.',
];

let newArr = []

for (let i = 0; i <= arr.length; i++) {
    newArr = arr.regExp(/Netflix/gm)[i]
}


console.log(newArr);
Sebastian Simon
  • 18,263
  • 7
  • 55
  • 75

0 Answers0