Whats the correct way to set keys for nested objects?

I have 3 objects within 1 object. inside those, a set of keys.
just to keep it easier to read i will just do a couple keys as an example.

setKeyValue ( setKeyValue ( mainObject, “object name”, setKeyValue ( setKeyValue ( nestedObject1, “key”, value, “key”, value ))) , “object name”, setKeyValue ( setKeyValue ( nestedObject2, “key”, value, “key”, value )))

what happens is the first key value works fine in each object list, but then when i add a second, third, fourth etc it just adds an “undefined” to my object list and doesnt link to the corresponding key. What am I doing wrong?

I hope this makes sense to someone.

I spend 3 hours+ looking at a problem, I ask on here and not 30 seconds after I post I realize the problem :joy: I guess thats how good you lot are, you help without even replying sometimes lol.

for those who might face the same question there should be a ) between value and the next key

"key, value ), “key”, value

so obvious :man_facepalming: