in the following code can we return the same thing without using the place variable, if yes how?

121
July 25, 2019, at 03:20 AM
function findMatches(wordToMatch, cities) {
  return cities.filter(place=> {
    const regex = new RegExp(wordToMatch, 'gi');
    return place.city.match(regex) || place.state.match(regex)
  });
}

this function filters the cities array according to the condition that they should match the wordToMatch and is part of ajax . i tried using console.log(place) it gave the array cities as output, again need help with that.

Rent Charter Buses Company
READ ALSO
Inheriting attributes from prototype

Inheriting attributes from prototype

I am working on a school assignment and I want to inherit the properties of a previous constructor functionI used object

108
Convert string to title case with JavaScript

Convert string to title case with JavaScript

Is there a simple way to convert a string to title case? Eg

190
Remove specific character if at the beginning of a string or consecutive at any place in a string

Remove specific character if at the beginning of a string or consecutive at any place in a string

I'm currently trying to make a regex to remove every of those character [0-9] \ - * \' if they are either at the beginning of the string, end of the string or if they are consecutive in a string

103
Stop video when modal is close - Plyr plugin

Stop video when modal is close - Plyr plugin

I created multiple video player in multiple modals with Plyr pluginOne video by modal

440