Created
March 10, 2015 17:54
-
-
Save whichsteveyp/0f979042a1cf00221292 to your computer and use it in GitHub Desktop.
I was not aware of the two syntax styles here. Are there valid uses/reasons for both?
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
// one | |
[].each(function (foo) { | |
return foo.info ? "hello" : "hi"; | |
}); | |
// two | |
[].each(function (foo) { | |
return foo.info ? "hello" : "hi"; | |
}); | |
// three | |
[].each(function (foo) { | |
foo.info ? "hello" : "hi"; | |
}); |
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
// one | |
[].each(foo => foo.info ? 'hello' : 'hi'); | |
// two | |
[].each((foo) => { return foo.info ? 'hello' : 'hi'; }); | |
// three | |
[].each((foo) => { foo.info ? 'hello' : 'hi'; }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment