Array.from

by amrendra kumar

HTML

<div class="people">
  <p>hii</p>
  <p>hello</p>
  <p>hoe w foing</p>
</div>

JavaScript

var people = document.querySelectorAll(".people p");

const str = Array.from(people, (item => item.textContent));
console.log(str)