Last active
May 30, 2019 08:15
-
-
Save lovetingyuan/5b7738d170311ca547cc032ac5c784cb to your computer and use it in GitHub Desktop.
one case to use void
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
function doSth() { | |
if (foo) { | |
doSomething() | |
return | |
} | |
if (bar) { | |
return bar | |
} | |
} | |
// ---------- | |
function doSth() { | |
if (foo) { | |
return void doSomething() | |
} | |
if (bar) { | |
return bar | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment