Created
July 12, 2017 08:06
-
-
Save morisasy/b336e603a250a82b165e4de66cd28a6a to your computer and use it in GitHub Desktop.
findMinLengthofThreeWords
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
//Write a function called "findMinLengthOfThreeWords". | |
//Given 3 words, "findMinLengthOfThreeWords" returns the length of the shortest word. | |
function findMinLengthOfThreeWords(word1, word2, word3) { | |
if (word1.length < word2.length) { | |
if (word1.length <word3.length) { | |
return word1.length; | |
}else { | |
return word3.length; | |
} | |
}else { | |
if(word2.length < word3.length) { | |
return word2.length; | |
}else { | |
return word3.length; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment