I defined a global Javascript function:
function resizeDashBoardGridTable(gridID){
var table = document.getElementById(\'treegrid_\'+gridID);
.....
This is what i'm doing:
var someGlobalVariable = 'some-value';
// work with someGlobalVariable...
// once done, set it to a Reference Error
someGlobalVariable = new ReferenceError('This variable is undefined.');
// now if we try to access:
console.log(someGlobalVariable); // ReferenceError: This variable is undefined
Good Luck...