Slalom Interview Question

Add two strings together written out as an integer. Ex "12" + "5" return "17"

Interview Answer

Anonymous

Apr 2, 2018

In javascript parseInt("12") + parseInt("5") However, I'd put the logic into a reusable function: parseInt(a) + parseInt(b) instead then call with the values for arguments.