I'm starting to use Lambda. I created a 'function/...
# suitescript
s
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 ?
e
I'm not aware of any way to make custom globals. So you do it just the way you said it. Save the function in a file, include the file in all relevant scripts
s
Thanks. I never had to include a file. What is the syntax ?
s
Thanks
s