Accessing internal Cesium function from outside of the script


I am coding a cesium app and I would like to call an internal cesium function that clears all primitives “function clearAll() { primitives.removeAll(); }” when i do a button press. I know about cesium’s built in toolbar buttons but I would like to use an html button I already have in place to call this function on click. It’s located in "" Any help would be appreciated!