I am looking to convert an array into an object, where each item in the array is separated into categories as shown below.
let a=['monkey: animal','John:human', 'Rob:human', 'donkey:animal']
I expect the output to be as follows;
output={
animal: ['monkey', 'donkey'],
human: ['John', 'Rob']
}