Am I using the .delete() method correctly?

I already found the solution, did the following:

           document.getElementById('btnDel').addEventListener('click', () => {


              handle.reset()
              widgetManager.removeWidget(handle);
              svgCleanupCallbacks.get(handle);
              svgCleanupCallbacks.delete(handle);
              handleTextProps.delete(handle);
                       
            renderWindow.render();
          });

This seems to work so far, thanks for the help!