const tags = document.querySelectorAll('p.phrase'); console.log([...tags].map(({textContent : txt}) => txt));