xxxxxxxxxx
const content = "This is a sample content with more than 20 words that needs to be truncated.";
const truncatedContent = truncateContent(content, 20);
console.log(truncatedContent);
// Output: "This is a sample content with more than 20 words..."