RecurringCharsInString

Run Settings
LanguageJavaScript
Language Version
Run Command
function recurringCharInString(str) { let input = str.toLowerCase(); let obj = {}; let count = 0; for (let i = 0; i< input.length; i++) { if (obj[input[i]]) { obj[input[i]]++; } else { obj[input[i]] = 1; } } console.log(obj); for (let key in obj) { if (obj[key] === 1 || key == ' ') delete obj[key]; } console.log('recurring characters are:') console.log(obj); return obj; } recurringCharInString('Shabbir Ahmed Khan');
Editor Settings
Theme
Key bindings
Full width
Lines