Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myFunc(input) {
- let output = input.replace(/[^A-Za-z0-9\s]+/gm, ' ')
- let result = []
- for (let w of output.split(' ')){
- if (w === '' || w === ' '){continue}
- result.push(w.toUpperCase())
- }
- console.log(result.join(', '))
- }
- myFunc('Functions in JS can be nested, i.e. hold other functions')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement