What’s the best way to pass a parameter into the s...
# suitescript
c
What’s the best way to pass a parameter into the search callback? search.run().each(function(result))?
b
I dont follow. The signature for the callback does not allow for a second parameter
e
Short answer is "you don't"
What kind of parameter/data are you trying to pass?
When I have some higher-level data I need, I'll generally use a partially applied function as my callback
but not everyone likes or is familiar with that approach
d
@erictgrubaugh you always intrigue me with these little tidbits. Now I'm reading up on 'partially applied functions'
s
lodash has a helper for this called
_.partial