Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 380 Bytes

check-repetition-in-string.md

File metadata and controls

12 lines (10 loc) · 380 Bytes

Exercise

Write a function that checks if a key is repeated in the string by creating an Object for the given string. If a key is repeated the function will return true. If no key is repeated it will return false

function checkRepetition(str){
// write your code here
}
console.log(checkRepetition("hello"));// true
console.log(checkRepetition("zebra"));// false