validate country wise phone code javascript

Solutions on MaxInterview for validate country wise phone code javascript by the best coders in the world

showing results for - "validate country wise phone code javascript"
Irene
07 Nov 2016
1country_codes=['91-', 'UK-44-', 'SZ-268-22']
2phone="91-123456789";
3
4is_valid_number = country_codes.some(elem => phone.match('^' + elem));
5console.log(is_valid_number );