use a different notation:
function addin(name, val) {
var full_js = {};
full_js[name] = val;
return JSON.stringify(full_js);
}
Ex:
at the moment you are always assigning the value to the name
key, instead of the dynamic name key, keep in mind that the key will always be the string representation of the variable used.
for example, addin({}, 'rony')
, will return {"[object Object]":"test"}