Store a value and compare it with previous value

just tell me onething, i am getting msg.payload.mypath but msg.payload.same is not returning any value...

msg.payload.same = ( msg.payload[0].D[0].value === context.get('hold') ) ? "same" : "not same";
context.set('hold', msg.payload[0].D[0].value)
return msg;