2 ms·
> you compare err != null?? besides not using strict mode, what should err be? a String? So, what will happen if err is undefined or an empty String? YOU are t
by flavio81 9y ago
> you compare err != null?? besides not using strict mode, what should err be? a String? So, what will happen if err is undefined or an empty String?
YOU are the one who made that comparison, not me. You originally wrote the following line:
( err ) ? console.err( msg ) : console.log( msg );
What do you think the "?" operator does with "err"?
> Then you call logFsResult with err while it is not used..
It seems you don't understand the code. I'm not calling "logFsResult", i am defining a function called logFsResult. You also did the same, you defined logFsResult to receive the "err" parameter.
function logFsResult( type, err ){
var msg= '';
switch ( type ) {
> That's a trap, I should rather make my code as readable, scalable and bug free as possible regardless of ESxxx.
ES6 allows you to write more readable code than ES5. Take a look at the features.