How do i convert the following string input
name: xyz friend: abc mobile: 123
into an array separating it as something like this
[{key:"name", value:"xyz"}]
I have tried this code for splitting
let friend1 =
'name:xyz
friend:abc
mobile_no:123'
let Array=friend1.split(" ");
console.log(Array)`
need help with the key and value part.