Skip to content

Instantly share code, notes, and snippets.

@mbbhalla
Created December 1, 2018 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbbhalla/d50c311a9564fcf1ee47d7152fd10255 to your computer and use it in GitHub Desktop.
Save mbbhalla/d50c311a9564fcf1ee47d7152fd10255 to your computer and use it in GitHub Desktop.
console.log (
(function(n: number): number {
if (n < 5) {
return // returns undefined which is not desired. Desired is n*2.
// Can "no statement after return" be checked by TS compiler ?
n * 2;
}
return n;
})(3)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment