// IIFE & return
let nct = ((username=`xgqfrms-GitHub`, repo=`Node-CLI-Tools`) => {
fetch(`https://api.github.com/repos/${username}/${repo}/commits`,{
data: {
client_id: '08ecc2f68d922f18800e',
client_secret: '5846d428b5340812b76c9637eceaee979340b922'
}
})
.then((response) => response.json())
.then((json)=> {
return repos = json;
})
.then((repos)=>{
console.log(repos);
});
})();
// undefined
let new_nct = ((username=`xgqfrms-GitHub`, repo=`Node-CLI-Tools`) => {
fetch(`https://api.github.com/repos/${username}/${repo}/commits`,{
data: {
client_id: '08ecc2f68d922f18800e',
client_secret: '5846d428b5340812b76c9637eceaee979340b922'
}
})
.then((response) => response.json())
.then((json)=> {
return repos = json;
})
.then((repos)=>{
console.log(repos);
return new_nct = repos;
});
})();
// new_nct
// repos
((username=`xgqfrms-GitHub`, repo=`Node-CLI-Tools`) => {
fetch(`https://api.github.com/repos/${username}/${repo}/commits`,{
data: {
client_id: '08ecc2f68d922f18800e',
client_secret: '5846d428b5340812b76c9637eceaee979340b922'
}
})
.then((response) => response.json())
.then((json)=> {
return repos = json;
});
})();
// repos
Created
June 28, 2017 01:42
-
-
Save xgqfrms-GitHub/b252342f28497eadc96134a5873814fb to your computer and use it in GitHub Desktop.
fetch & IIFE & ES6 & return undefined
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
microsoft/TypeScript-Website#2256