Untitled
3 months ago in JavaScript
function
createStyleObject
(
classNames
,
style
)
{
return
classNames
.
reduce
(
(
styleObject
,
className
)
=>
{
return
{
...
styleObject
,
...
style
[
className
]
}
;
}
,
{
}
)
;
}
function
createClassNameString
(
classNames
)
{
return
classNames
.
join
(
' '
)
;
}