Currently I use one button to display a side menu and another to close it
Here's what you can do, I call this "trick" a custom toggle :
$(document).ready(function(){
$(/*selector for the button*/)
.click(function(){
const $this = $(this);
let prop = $this.prop("opened");
if(prop === undefined){
$this.prop("opened", false);
prop = $this.prop("opened");
}
if(prop === false){
/*handle opening here*/
}
if(prop === true){
/*handle closing here*/
}
$this.prop("opened", !prop);
});
});