JSON and using variable as part of key

Hey all. I have a bit of code that runs on several computers and each computer has a id number
the code is

msg.payload = {“x”: d}

but I want to add a variable to the "ID1 to the front of the X so the line basicallily ends up with
msg.payload = {“ID1x”: d}

on pc 2 it would be
msg.payload = {“ID2x”: d}

I have tried

var id = “ID2”
msg.payload = {id + “x”: d}

and that doesnt work and a few other things. Help anyone?

var id = "id2";
id = id + "x";
var testdict={};
testdict[id]="d";
msg.payload = testdict;
return msg;