Update the readme examples to use arrow functions instead to the function keyword
See original GitHub issueSection/Content To Improve
Performing a
GETrequest
const axios = require('axios');
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
// handle success
console.log(response);
})
.catch(function (error) {
// handle error
console.log(error);
})
.then(function () {
// always executed
});
Suggested Improvement
Performing a
GETrequest
const axios = require('axios');
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(response => {
// handle success
console.log(response);
})
.catch(error => {
// handle error
console.log(error);
})
.then(()=> {
// always executed
});
Relevant File(s)
README.md
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How To Use Javascript Arrow Functions & This Keyword
This guide will discuss how to use the arrow function to write your JavaScript functions. Focusing on converting regular functions to arrow ......
Read more >https://raw.githubusercontent.com/microsoft/Web-De...
JavaScript Basics: Methods and Functions 
@sanketpathak64 we first need to provide a rational - why is this change better. Using the function notation, the
functionword stands out and helps readability.We need to provide reasoning for this sort of change.