Is there a way in JavaScript to determine if a string begins with any of the strings contained within an array?
For instance,
You have an array comprised of strings:
const substrs = ['the', 'an', 'I'];
And you also possess a string:
const str = 'the car';
What steps can be taken to ascertain whether str starts with any string from the substrs array?