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());
}
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());
}
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 aPromise
, which is usually not what you want in async functions.await
can even make sense if an async function doesn’t return anything.