This answer helps a lot when we have one word in string and one word in substring. Method includes()
do the job. Any idea how to solve this if there is more than one word in string and more then one word in substring? For example:
const string = "hello world";
const substring = "hel wo";
console.log(string.includes(substring)); --> //This is false, but I want to change the code to return true
Should I create some arrays from string and substring using split(" ")
and than somehow compare two arrays?