Skip to content

Tag: arrays

Javascript find matched sentence with predefined words

Hello guys I need help to figure out an expression. I got phrases like As you see above, target’s three words matches with last sentence. The purpose is to find sentence includes most matched words. I did like But it gives nothing Answer Use .filter(), .some(), .includes() and .sort() methods as explain…

unable to print result line by line

I am unable to print result in line by line,it’s coming in one line ,how to solve this…. I tried this code- Answer There is 2 issues in it: the for loop i you need to declare as a var or let(I recommend let) there is no replace method in array, you can use map in this case So you