Closed marcolarosa closed 2 years ago
Don't use positional arguments as in:
function lookupA(packname, find) {} lookupA('glottolog', 'noongar') packName = glottolog, find = noongar lookupA('noongar', 'glottolog') packName = noongar, find = glottolog
Do you a destructured object
unction lookupB({ packName, find, fields=['@id', 'name'] }) { } lookupB({packName: 'glott0', find: 'noongar'}) lookupB({ find: "noongar", packName: "glotto" }); // by default - lookup @id and name fields lookupB({ find: "noongar", packName: "glotto", fields: ['alternateName'] });
So the main find method will need to be a for (lookup forEach) loop inside the main body that iterates over the properties in the field array.
the function in lookup.js has now a destructured object as argument
Closing - replaced by #8
Don't use positional arguments as in:
Do you a destructured object
So the main find method will need to be a for (lookup forEach) loop inside the main body that iterates over the properties in the field array.