Essential JavaScript

Going Further

Stretchy Word Kata

Given a word (string) and a stretchFactor (integer number), return the word with each character multiplied by the stretch factor.

Example:

const stretchedWord = stretchWord("apple", 3); console.log(stretchedWord); // "aaappppppllleee"

If stretchFactor is zero, return the original word.

Code Editor

Click "Run Tests" to execute your function and see the test results below.

Test Results

Run your code to see test results

Console Output

// Console output will appear here...

0 output lines