Last active
December 14, 2021 14:56
-
-
Save inspector-ambitious/4b4d1a9d5b2696686aadb21ec22175c6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // Step 1: Create a function that will return the number of words in a text | |
| const countWords = (text) => { | |
| } | |
| console.log(countWords("")); // 0 | |
| console.log(countWords(" ")); // 0 | |
| console.log(countWords("JavaScript !!! ")); // 1 | |
| console.log(countWords(" JavaScript")); // 1 | |
| console.log(countWords(" JavaScript is cool ")); // 3 | |
| // Step 2: Create a function that render all the words as follow | |
| // <ul> | |
| // <li>word1</li> | |
| // <li>word2</li> | |
| // </ul> | |
| const renderWords = (text, rootEl) => { | |
| }; | |
| renderWords(" JavaScript is cool !", document.body); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment