Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve() {
- let input = document.getElementById('input').value
- let splittedText = input.split('.').filter(x => x !== "").map(y => y + ".")
- let output = document.getElementById('output')
- output.innerHTML = ""
- let paragraphNum = Math.ceil(splittedText.length / 3)
- for (let i = 0; i < paragraphNum; i++) {
- let finalString = sentence.splice(0, 3).join(", ")
- output.innerHTML += `<p>${finalString}</p>`
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement