'13912345678'.replace(/\d{5}$/g, 'xxxxx');
 
'13912345678'.replace(/(1[3456789]\d{4})\d{5}$/g, '$1xxxxx');