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
// Move Capital Letters to the Front | |
// Create a function that moves all capital letters to the front of a word. | |
// Examples | |
// capToFront("hApPy") ➞ "APhpy" | |
// capToFront("moveMENT") ➞ "MENTmove" |
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
// Hiding the Card Number | |
// Write a function that takes a credit card number and only displays the last four characters. | |
// The rest of the card number must be replaced by ************. | |
// Examples | |
// cardHide("1234123456785678") ➞ "************5678" | |
// cardHide("8754456321113213") ➞ "************3213" |
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
// https://edabit.com/challenge/Mc6Xi4PRw7fDzeMDB | |
// Create a function that takes a string and returns a string in which each character is repeated once. | |
// Examples | |
// doubleChar("String") ➞ "SSttrriinngg" | |
// doubleChar("Hello World!") ➞ "HHeelllloo WWoorrlldd!!" |
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
// Your task in order to complete this Kata is to write a function which formats a duration, given as a number of seconds, in a human-friendly way. | |
// The function must accept a non-negative integer. If it is zero, it just returns "now". Otherwise, the duration is expressed as a combination of years, days, hours, minutes and seconds. | |
// It is much easier to understand with an example: | |
// formatDuration(62) // returns "1 minute and 2 seconds" |
NewerOlder