Skip to content

Instantly share code, notes, and snippets.

View ziazon's full-sized avatar
🚂
Chugging along

Zia Zon ziazon

🚂
Chugging along
View GitHub Profile
@ziazon
ziazon / mask_credit_card_string.js
Created February 8, 2013 10:23
This function will mask any string up to the last four characters. Useful for credit card numbers, hence the function name.
function maskCreditCard(str){
return Array(str.slice(0,-3).length).join('*')+str.slice(-4);
}