Here you go, without String manipulation:
const str = '
Header
Paragraph
'
const div = document.createElement('div');
div.innerHTML = str;
const [h, p] = [...div.children].map(el=>el.textContent);
console.log(h, p);
Run code snippetExpand snippet
Or even cleaner, using the experimental DOMParser API:
const doc = new DOMParser().parseFromString('
Header
Paragraph
', 'text/html');
const [h, p] = [...doc.body.children].map(el=>el.textContent);
console.log(h, p);
Run code snippetExpand snippet