Passing a string and a null value to a variable alternatively from pre-script to the body

My question:
How can I pass null value to the parttime variable when fulltime is selected as the staff and pass a string as a staff name when parttime is selected as the staff. Similar in case of fulltime staff

I’ve already tried:

in the body
“staff” : “parttime”; // or fulltime
“parttimestaff”: “{{parttime}}”; // if part time staff is selected, then set part time staff name else null
“fulltimestaff”: “{{fulltime}}”; //if full time staff is selected, then set full time staff name else null

in the pre-script
if (pm.environment.get(“staff”) == “parttime”)
pm.environment.set(“fulltime”, undefined);
var parttime= [“harry”, “michael”, “adam”, “ariana”, “simon”];
pm.environment.set(“parttime”, parttime);
pm.environment.set(“parttime”, parttime[Math.floor(Math.random() * parttime.length)]);

pm.environment.set(“parttime”, undefined);
var fulltime= [“john”, “johnny”, “brian”];
pm.environment.set(“fulltime”, fulltime);
pm.environment.set(“fulltime”, fulltime[Math.floor(Math.random() * fulltime.length)]);

This is not working
the null value is passed as a string