I am scripting automation in Javascript, using jest and puppeteer right now, and I want to verify a name, for example;
I have a name of const name = Watson, James R. and wanted to compare the name const info_name = Watson James , which we can hypothetically say that they are the same person. When I was using python and selenium I usually use, in just to check the presence of a letter or word inside a string or list, so my question is, what is the best function I can use?
I saw the use of .includes but it is too "case sensitive" one different character and it gives off "False" result. Also I saw .some but I get an error of ".some is not a function".
What can I use for alternatives? I would gladly appreciate your replies, Thank you in advance!
info_name(e.g. "Watson") are contained inname?