I call a function with bunch of nested method, i’m using web scraping tools called cheerio and i want to get the text out of it so i need to call a bunch of function. here’s my example code.
var text = $(el)
.children()
.first()
.children()
.first()
.children()
.first()
.text()
.replace(/ss+/g, " ");
My question is, how can i simplify my function so I have the same result without chaining my function?