I wrote this code:
var arr = ['ясно','понятно']; var a = new RegExp(arr, 'i'); var b = 'ясно'; b.match(a); For example, in the arr 2 array, the words: 'clear', 'clear', and these words can be searched separately. Those. separately: 'clear', separately: 'clear'.
How to set several words for search correctly and how to bring the code into working condition?
var a = new RegExp(arr.join('|'), 'i');- kmv