Level 104
Not entirely sure if you're trying to generate the workingDays value, or something else???
Object.fromEntries(days.map(day => [day, 4]))
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hello I have this code
let days = [2,3,4]
let hours = 4
I want to create an object to link the hours to each day
const workingDays = {
2:4,
3:4,
4:4,
}
I tried array.map inside the workinDays I guess it doesn't work that way
Please or to participate in this conversation.