My Javascript function leads my console to return me :
TypeError: style is null
Here the snippet:
let style = {
one: 1,
two: 2,
three: 3
}
function styling(style = style, ...ruleSetStock) {
return ruleSetStock.map(ruleSet => {
console.log(ruleSet)
return style[ruleSet]
})
}
console.log(styling(null, "one", "two", "three"))
I can't understand why. It seems to me everything is great,
Any hint would be great, thanks.