Not sure if this is the best way (curious about 'Ref'), but you could also make x a 1-element vector:
const x = [0] x[1] += 1
Not sure if this is the best way (curious about 'Ref'), but you could also make x a 1-element vector:
const x = [0] x[1] += 1