Skip to content

Instantly share code, notes, and snippets.

@itaditya
Created August 1, 2020 14:46
Show Gist options
  • Select an option

  • Save itaditya/73b06d25efab2d273f03f7fe8038a0cb to your computer and use it in GitHub Desktop.

Select an option

Save itaditya/73b06d25efab2d273f03f7fe8038a0cb to your computer and use it in GitHub Desktop.
(Blog) Why named arguments are better than positional arguments
// 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