filmov
tv
Finding the Shortest Word Length in JavaScript Codewars Kata Tutorial kyu 7 codeWars Shortest Wor

Показать описание
Hey everyone, welcome to another Codewars challenge! 👋
Today we’re tackling the "Shortest Word" kata. Our task is simple: given a string of words, return the length of the shortest word in the string.
Example Breakdown:
For the string "The quick brown fox", the shortest word is "fox" with a length of 3.
For "JavaScript is awesome", the shortest word is "is" with a length of 2.
Let’s walk through the steps to solve this! 🚀
Step-by-step solution:
First, we split the string into individual words using .split(' '), where each word is separated by a space.
Next, we use .map() to transform the array of words into an array of word lengths.
That’s it! We now have the length of the shortest word.
Here’s the complete code:
function findShort(s) {
}
Feel free to try this out, and don’t forget to test with different inputs. See you in the next kata! 😊
#CodeWars
#JavaScriptKata
#CodingChallenge
#JavaScriptTutorial
#ProblemSolving
#LearnJavaScript
Today we’re tackling the "Shortest Word" kata. Our task is simple: given a string of words, return the length of the shortest word in the string.
Example Breakdown:
For the string "The quick brown fox", the shortest word is "fox" with a length of 3.
For "JavaScript is awesome", the shortest word is "is" with a length of 2.
Let’s walk through the steps to solve this! 🚀
Step-by-step solution:
First, we split the string into individual words using .split(' '), where each word is separated by a space.
Next, we use .map() to transform the array of words into an array of word lengths.
That’s it! We now have the length of the shortest word.
Here’s the complete code:
function findShort(s) {
}
Feel free to try this out, and don’t forget to test with different inputs. See you in the next kata! 😊
#CodeWars
#JavaScriptKata
#CodingChallenge
#JavaScriptTutorial
#ProblemSolving
#LearnJavaScript