Word Lengths

L1 Easy Strings
Concept
Strings report their size through count. Mapping a list of words to their lengths reuses the build-a-new-array pattern.
Given an array of words, return a new array holding the length of each word in the same order.
Examples
▸ words = ["hi", "there", "a"]
→ [2, 5, 1]
▸ words = []
→ []
▸ words = ["swift"]
→ [5]
Progressive Hints
Hint 1 · Nudge
Turn each word into its own size and keep them in the same order.
Hint 2 · Plan
Create an empty result array. For each word, append its length. Return the result array.
Hint 3 · Approach
result = []. For each word: append word.length. Return result.
Output
// Run your code to see the output here.