Hinge joint spring variable (c#)

Hi, for my game I need to change the spring of some hinge joints and also the motors.

But I get this errors:
Cannot modify a value type return value of UnityEngine.HingeJoint.motor'. Consider storing the value in a temporary variable. Cannot modify a value type return value of UnityEngine.HingeJoint.spring’. Consider storing the value in a temporary variable

What’s even worse is that unity documentation doesn’t help at all, since it has the same mistake in there: Unity - Scripting API: HingeJoint.spring

So, how can I save the spring of an hinge joint inside a variable?
Thanks in advance

First, let me say that I don’t know anything about JointSprings and/or how to use them.

However, I am familiar with making things work in Unity… so perhaps:

using UnityEngine;
using System.Collections;

public class Example : MonoBehaviour {

JointSpring mySpring;

    void Start() {
        mySpring = hingeJoint.spring;
           
        mySpring.spring = 10;
        mySpring.damper = 3;
        mySpring.targetPosition = 70;

        hingeJoint.spring = mySpring;
    }
}