“isogramme” Réponses codées

isogramme

const isIsogram = str => {
  str = str.toLowerCase().split('')
  let dupArr = [...new Set(str)]
  return dupArr.join('').length === str.join('').length
}
console.log(isIsogram("Dermatoglyphics"))
kouqhar

Isogramme

// An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains only letters is an isogram. Assume the empty string is an isogram. Ignore letter case.

const isIsogram = str => {
  str = str.toLowerCase().split('')
  let dupArr = [...new Set(str)]
  return dupArr.join('').length === str.join('').length
}
console.log(isIsogram("Dermatoglyphics"))

// With love @kouqhar
kouqhar

Réponses similaires à “isogramme”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code