Hello I was wondering if anybody could help, i'm trying to search a string for a word and console log the amount of times that word appears in the string, however I only want it to return the count of whole words it finds, so at the moment the example below will return '3' because it will find 'car' twice but also the word 'care' which contains the word 'car' within it, is there anyway I can amend the code so it only finds the whole word and not words it's inside?
Many thanks.
<div class="sentence">I have a car and I need to take good care of this car</div>
let find = 'car';
let count = $('.sentence').text().split(find).length - 1;
console.log(count);