A Pen by Afaq Ahmed Khan on CodePen.
Created
December 25, 2018 06:51
-
-
Save afaqahmedkhan/2d4bfd53778831c5ef4cdc03857fbf1d to your computer and use it in GitHub Desktop.
Intermediate Algorithm Scripting: Make a Person
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addTogether(a,b) { | |
if(isNaN(a)){ | |
return undefined; | |
} | |
if(!b){ | |
return (b) => typeof(b) !== 'number' ? undefined: a + b; | |
} else { | |
return typeof(b) !== 'number' ? undefined: a + b; | |
} | |
} | |
console.log(addTogether(2,'3')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment