How do I delete an edge?

Solution for How do I delete an edge?
is Given Below:

The documentation isn’t clear on how to delete an edge. I’ve tried

this.cyNetwork.remove("edge[id == #" +  id +"]");
this.cyNetwork.remove("edge[id == " +  id +"]");
this.cyNetwork.remove(id);

All of this just says the selector is invalid.

Try this.cyNetwork.$id(id).remove(); Check the docs for get element by id https://js.cytoscape.org/#cy.getElementById remove element https://js.cytoscape.org/#eles.remove