So I am working in typescript where I need to modify an array to some specific pattern.
Here is my array:
["sunday","monday","tuesday"]
This is what I need it to be like:
["day:Sunday","day:Monday","day:Tuesday"]
I have already tried map method like this:
result = arr.map(x => ({day: x}));
But map gives me result some different which is not needed:
[{"day":"sunday"},{"day":"monday"},{"day":"tuesday"}]