Created
December 1, 2018 09:00
-
-
Save mbbhalla/d50c311a9564fcf1ee47d7152fd10255 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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