const getAddition = (str) => { return str.split('+').reduce((total, num) => (total + num * 1), 0); }; const addition = getAddition('1+1');
сложение равно 2.