So, the challenge is that we are trying to detect if a string matches a fixed phone number pattern, this is a simple string pattern.
The pattern is:
you can use regex for that:
if(/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/.test('123-456-7890')) //ok else //not ok