First of all renderCrumbs: function(breadCrumbs, state, node) { ... }
makes no sense, because you're using Object
property notation with no Object to be found. If it is contained within an Object
which is not visible in the code snippet then all is fine, but keep in mind that you must reference the object to call the function in the following code snippet, e.g. obj.renderCrumbs()
.
Secondly, and problematically, you may be tempted to use change
as a global. Don't do this, globals are bad. Read more here. Further information is available elsewhere with a little googling.
The best solution that I can see is to change the functionality of renderCrumbs
to
function renderCrumbs(breadCrumbs, state, node) {
return 'Change Data';
}
and then you can do
var generateSearchObject = function() {
var searchObj = {
"fileName": renderCrumbs(),
"tabType": text.toUpperCase(),
"offset": offValue,
};
return searchObj;
};