How to organize a search in an array using regular expressions? For example, here’s the code:
var arr = ['земля', 'вода', 'воздух', 'огонь']; $('input').keyup(function(){ var val = $('input').val(); var re = new RegExp(val, 'i'); var result = arr.match(re); return result.input; }); How to make the 'fire' permissible when entering, it returns the 'fire'?