How to remove values from an array in Stylus?

There is such piece of code:
$colors = {
 'primary' : #124af5
 'dark' : #222222
 'white' : #ffffff
}


Then copy $colors in $colors-2 and remove one of the values:
$colors-2 = $colors
remove($colors, 2, 'primary')

It works, but is removed from all variables.

How to remove values only from the second variable?
June 8th 19 at 17:17
1 answer
June 8th 19 at 17:19
Solution
The problem is that after the line $colors-2 = $colors both variables point to the same hash (the array). Instead of this lines you have to write $colors-2 = merge({}, $colors)to copy the contents of the $colors in $colors-2, and then $colors-2 will have to point to the copy, not on the same hash. Something like that.
Thank you!!! - Giovani.Bogisi commented on June 8th 19 at 17:22

Find more questions by tags CSSStylus