Domanda di colloquio di Slalom

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

Risposta di colloquio

Anonimo

2 apr 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.