Skip to content

Instantly share code, notes, and snippets.

View ArnaudBuchholz's full-sized avatar
🏠
Working from home

Arnaud Buchholz ArnaudBuchholz

🏠
Working from home
View GitHub Profile
@renoirb
renoirb / README.md
Last active April 7, 2022 06:04
Renoir's references to books and chapters

ECMAScript

Async/Await

We should not forget await

Quoting [We should not forget the await (Exploring ECMASCript 2016-2017; 5.3.1 Don’t forget await][public-book-exploring2016-17-async-do-not-forget-await])

[out value] is set to a Promise, which is usually not what you want in async functions. await can even make sense if an async function doesn’t return anything.

@getify
getify / 1.md
Last active January 17, 2020 16:35
A question about JS parameter scopes, and closures over them vs function scopes

I received a question about this snippet of code:

function def(first="oldValue" , second=function(){
         return first;
}){
        var first="updatedValue";
        console.log('inside',first);
        console.log('function',second());
}