I have an array of strings like this. Both left and right portions in the string are separated with spaces (More than 1 space for each).
const arr = [
'A1789 Other tuberculosis of nervous system',
'A179 Tuberculosis of nervous system, unspecified',
'A1801 Tuberculosis of spine'
];
I need to turn this into an array of objects like this, with the first portion as the key and the second portion as the value of the key.
const arrOfObj = [
{ A1789: 'Other tuberculosis of nervous system' },
{ A179: 'Tuberculosis of nervous system, unspecified' },
{ A1801: 'Tuberculosis of spine' }
];