Not able to make the proper payload

I am creating a request variable for my payload

var formData = execution.getVariable('formData');
var spinJson = S(formData);
print("JSON REQUEST :"+spinJson); //It's printing properly "{"req":[{"id":"2"}]}"
var req = { "path":"path", "params":  formData};
print(" payload: " +JSON.stringify(req)); //Prints : payload: {"path":"path"} and not printing "params" object
req = { "path":"path", "params": {"req":[{"id":"2"}]}};
print(" payload: " +JSON.stringify(req)); //Prints : payload: {"path":"path","params":{ "path":"path", "params": {"req":[{"id":"2"}]}}

May I know what’s the problem with the above code?
Edit: I tried replacing formData with spinJSON and it’s still same issue.