lets say if I put a random value instead of 45 then?
like making it a motion preset
where
I draw a shape with any scale value and link that shape's scale property to slider control using expression
If I'm understanding what you want, you have a couple options here:
1) You can replace the hard-coded [45, 45] with a variable so you don't have to enter the value twice inside of the linear() function. This would look like this:
const scaleController= effect("Slider Control")("Slider");
const newScale = 58;
linear( scaleController, 0, 100, [0,0] , [newScale, newScale] );
2) You can skip the extra step all together and manually set the scale of the new shape to your desired final size, then you can apply this expression to the property.
const scaleController= effect("Slider Control")("Slider");
linear( scaleController, 0, 100, 0 , value);
value means the pre-expression value, and while the property value will get overwritten by an expression, the original value still exists behind it. So the function is now saying "as the slider goes from 0 to 100, go from 0 to whatever my pre-expression value is on this property. This has the benefit of being dynamic because you can still scrub the property, manually type a value, or even keyframe the property, even though the expression is applied. Also, you only have to write the one word instead of typing out an array because value already represents an array on a Scale property.
You'll also notice that you can actually write "0" instead of "[0, 0]" as the fourth argument in any of the instances here. What's great about this is that it makes this expression even more modular—it means that you can apply this same expression to Opacity or Rotation, which are both scalar (a single value) vs an array without having to modify the code to match the property type.