https://github.com/gitfoxcode/javascript-challenges
A collection of various javascript challenges, my solutions and so on
https://github.com/gitfoxcode/javascript-challenges
javascript
Last synced: 11 months ago
JSON representation
A collection of various javascript challenges, my solutions and so on
- Host: GitHub
- URL: https://github.com/gitfoxcode/javascript-challenges
- Owner: gitFoxCode
- Created: 2022-07-14T17:00:43.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-14T17:29:16.000Z (almost 4 years ago)
- Last Synced: 2025-04-08T21:51:11.186Z (about 1 year ago)
- Topics: javascript
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### Javascript Challenges
A collection of various tasks from the Internet that can be done in javascript. In `solutions` next to a given task there is my solution to a given problem and possibly the best solution and the fastest solution.
___
**#1 Characters, words and lines**
Write a function that takes a string as a
parameter. The function must count
characters, words and lines, returning an
object with these values. [@fabiocberg](https://www.instagram.com/p/Cf6IaacrP3h/)
```Javascript
// Complete the function
function pharseParser(pharse){
return;
}
pharseParser("Once upon a time")
// { characters: 16, words: 4, lines: 1 }
pharseParser("Happily Ever After")
// { characters: 18, words: 3, lines: 1 }
pharseParser("True courage is facing danger when you are afraid.\nThe Wizard of OZ")
// { characters: 70, words: 14, lines: 2 }
```