Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save afaqahmedkhan/2d4bfd53778831c5ef4cdc03857fbf1d to your computer and use it in GitHub Desktop.
Save afaqahmedkhan/2d4bfd53778831c5ef4cdc03857fbf1d to your computer and use it in GitHub Desktop.
Intermediate Algorithm Scripting: Make a Person
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