In javascript, how can I check if a string starts with any of the strings in an array.
For example,
I have an array of strings,
const substrs = ['the', 'an', 'I']; I have a string
const str = 'the car'; How can I check if str starts with any of the strings in substrs?
theand likethere was a car? should that match or not?['the', 'an', 'I'].toLocaleString()to getthe,an,Iand you have two strings and can manipulate them