I'm starting to use Lambda. I created a 'function/ variable ' that is working very well
const ifEmpty = (thisVar) => {
return (
thisVar === '' ||
thisVar == null ||
thisVar == undefined ||
(thisVar.constructor === Array && thisVar.length == 0) ||
(thisVar.constructor === Object && Object.keys(thisVar).length === 0)
);
}
I agree, the function can be improve but for now, I'll use it as example.
I will need that const in all my scripts. I will need to save the const in a file and include the file in all my scripts. How can it be done ?