Exactly. layer.opacity returns a string (to work with input range fields), so +opacity casts it to a number.