JSFiddle - React, Tailwind, and code Playground
by himel023
JavaScript
str = `Java was originally designed for interactive television, but it was too advanced technology for the digital cable television industry at the time. From 2005 to December 2012, he worked at Google, where he spent half of his time developing the Python language. There is a lot of controversy and intrigue surrounding the invention of the telephone. Leonardo da Vinci was fascinated by the idea of Daedalus and Icarus flying and so designed a helical screw machine. Many other notable figures are also remembered for their work with electric batteries, lamps and the creation of the first incandescent bulbs. .`
ar = str.split(".");
console.log(ar);
clearEmptyIdx = (ar) => {
let cleared = ar.filter((item, idx) => {
return item.replace(/\s/g, '').length;
})
return cleared;
}
console.log(clearEmptyIdx(ar));