Created
August 1, 2020 14:46
-
-
Save itaditya/73b06d25efab2d273f03f7fe8038a0cb to your computer and use it in GitHub Desktop.
(Blog) Why named arguments are better than positional arguments
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
| // request with url as positional arg and options as named args. | |
| fetch('https://google.com', { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| }, | |
| }); | |
| // basic GET requests with just positional args | |
| fetch('https://google.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment