How do undefined or remove a javascript function?

后端 未结 5 912
不知归路
不知归路 2021-02-06 00:05

I defined a global Javascript function:

  function resizeDashBoardGridTable(gridID){
  var table = document.getElementById(\'treegrid_\'+gridID);
        .....
          


        
5条回答
  •  攒了一身酷
    2021-02-06 00:28

    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...

提交回复
热议问题