Last active
September 22, 2019 13:09
-
-
Save datrine/3f2fe9cc97a12b636f79011765f0ff0a to your computer and use it in GitHub Desktop.
linear_no_callback
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
| ((a)=>{ //"linearized" code without callbacks, an async-esque way to "linearize" asynchronous code | |
| let value=++a | |
| value*=value | |
| value=++value | |
| console.log(value); | |
| })(1); //note the semicolon | |
| //example below might seem far-fetched/over-the-top but it does prove that linear | |
| //code may be much easier to read than code with callback | |
| ((a)=>{ | |
| console.log(((++a)*(a)+1)) | |
| })(1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment