I just need to know why the dollar sign is needed at the end of the regex for validating US phone numbers
function telephoneCheck(str) {
return (/^(1)?(\s)?(\(\d{3}\)|\d{3})[\s-]?\d{3}[\s-]?\d{4}$/).test(str)
}
console.log(telephoneCheck("551-555-5555"));