Last active
November 18, 2021 19:12
-
-
Save evgeniyworkbel/7a960977a8c7b8484a2a9fbf64fcf82e to your computer and use it in GitHub Desktop.
Подготов. курс JS (code-basics.ru)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Спрятывание номера карты любым количеством звездочек*/ | |
// BEGIN (write your solution here) | |
const getHiddenCard = (cardNum, starCount = 4) => { | |
const cardNumCut = cardNum.slice(starCount, cardNum.length); | |
return cardNumCut.padStart(cardNum.length, '*'); | |
}; | |
// END | |
export default getHiddenCard; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment