function add(number) {
return function(nextNumber) {
if (nextNumber === undefined) {
return number;
}
return add(number + nextNumber);
}
}
// Define function
function wait(timeMS, callback) {
const f = new Promise((resolve) => {
setTimeout(() => {
resolve();
}, timeMS);
});
if (!callback) return f;
const phoneUtil = require('google-libphonenumber').PhoneNumberUtil.getInstance();
const PNF = require('google-libphonenumber').PhoneNumberFormat;
const phoneNumber = '0461234567';
const regionCode = 'fi';
const parsed = phoneUtil.parse(phoneNumber, regionCode);
const internationalNumber = phoneUtil.format(parsed, PNF.INTERNATIONAL);
const internationalParsed = phoneUtil.parse(internationalNumber);
const regionCodeFromInternationalNumber = phoneUtil.getRegionCodeForNumber(internationalParsed);