employer cover photo
employer logo
employer logo

Ness Digital Engineering

Engaged Employer

Ness Digital Engineering Interview Question

write program to give same out put for... sum(2,3) and sum (2) (3).. and also how

Interview Answer

Anonymous

Oct 16, 2018

function sum(a,b){ return (b===undefined)?((c)=>a+c):(a+b); } console.log(sum(2,3)); //5 console.log(sum(2)(3)); //5