I have an array of strings.
const periods = ["2021-03-31", "2021-02-28", "2021-01-31"]
I want to create a dictionary array from this array. My result should look like this:
[
{value: "2021-03-31",label : "2021-03-31"},
{value: "2021-02-28",label : "2021-02-28"},
{value: "2021-01-31",label : "2021-01-31"}
]
Is it possible to do it with map function.
const periodsDictArray = periods.map(el => ??? )