Try to set value then return the value.
npm install -S @jswork/next-try-set
import '@jswork/next-try-set';
const obj = { name: 'fei', email: '1290657123@qq.com' };
const res1 = nx.trySet(obj, 'name', 'feizheng');
const res2 = nx.trySet(obj, 'github', 'afeiship');
// results:
// afei
// afeiship
Code released under the MIT license.