Skip to content

Instantly share code, notes, and snippets.

@uzorjchibuzor
Created July 7, 2018 16:09
Show Gist options
  • Save uzorjchibuzor/0e23790d210a7c9c67346dc1d545fc9e to your computer and use it in GitHub Desktop.
Save uzorjchibuzor/0e23790d210a7c9c67346dc1d545fc9e to your computer and use it in GitHub Desktop.
Function to determine whether a word is an isogram or not.
function isIsogram(check){
if (check) {
for (let i = 0; i < check.length; i++) {
for (let j = i + 1; j < check.length; j++) {
if (check[i] === check[j]) return false;
}
}
return true;
}
return 'Invalid Entry!'
}
isIsogram('abcdefghijklmnopqrstuvwxyz');
@Oluwasetemi
Copy link

Oluwasetemi commented Jul 18, 2018

function isIsogram(check) {
  if (check) {
    for (let i = 0; i < check.length; i++) {
      for (let j = i + 1; j < check.length; j++) {
        if (check[i] === check[j]) return false;
      }
    }
    return true;
  }
}

isIsogram('abcdefghijklmnopqrstuvwxyzz'); //return false
// Nice Job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment