Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve () {
- let input = document.getElementById('input')
- let output = document.getElementById('output')
- let sentences = input.textContent
- .split('.')
- .filter(x => x !== '')
- .map(x => (x += '.'))
- for (let i = 0; i < sentences.length; i += 3) {
- let p = document.createElement('p')
- p.textContent = sentences.slice(i, i + 3).join('')
- output.appendChild(p)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement