/**
 * Beginning with 6 or 7 follow by three digits, then a dash and ends with four digits only
 */ const mobilePhoneRegExP = /^[67]\d{3}-\d{4}$/ ; /**
 * Beginning with 2 follow by three digits, then a dash and ends with four digits only
 */ const residentialPhoneRegExP = /^2\d{3}-\d{4}$/ ; param { string } phone returns { boolean } export function isMobilePhoneNumber ( phone ) { if ( typeof phone !== 'string' ) return false ; return mobilePhoneRegExP . test ( phone ) ; } param { string } phone returns { boolean } export function isResidentialPhoneNumber ( phone ) { if ( typeof phone !== 'string' ) return false ; return residentialPhoneRegExP . test ( phone ) ; } param { string } phone returns { boolean } export function isPhoneNumber ( phone ) { return isMobilePhoneNumber ( phone ) || isResidentialPhoneNumber ( phone ) ; }