How can I change an array to an object and also change the key name [the most optimized and shortest way]?
I want to change this
[
Jun 16 2022,
Jun 17 2022
]
to this
{
"from": "Jun 16 2022",
"to": "Jun 17 2023"
}
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
How can I change an array to an object and also change the key name [the most optimized and shortest way]?
I want to change this
[
Jun 16 2022,
Jun 17 2022
]
to this
{
"from": "Jun 16 2022",
"to": "Jun 17 2023"
}