parse date and number from API results
Rather than declaring the variables with let (you should always prefer const) and concatenating and reassigning, consider creating arrays of numbers and dates instead, eg:
[2, 3] and [&quot;2020-09-15&quot;, &quot;2020-09-16&quot;]
Then after the loop is done, join all elements by newlines.
For the regular expression, rather than split, I think match would be more appropriate. You can use \((\d+)\) (\S+):

\( - literal (
(\d+) - 1st capturing group, composed of digits
\) - literal )
  - literal space
(\S+) - 2nd capturing group, composed of non-spaces

Then extract the 1st and 2nd capturing groups.


const data = [
  "(2) 2020-09-15", "(3) 2020-09-16"
];
const numbers = [];
const dates = [];
for (const item of data) {
  const [, number, date] = item.match(/\((\d+)\) (\S+)/);
  numbers.push(number);
  dates.push(date);
}
console.log(numbers.join('\n'));
console.log(dates.join('\n'));