mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-12-19 08:59:05 +08:00
Make it possible to delete all vertex edges at once.
This commit is contained in:
@@ -119,6 +119,15 @@ export default class GraphVertex {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {GraphVertex}
|
||||
*/
|
||||
deleteAllEdges() {
|
||||
this.getEdges().forEach(edge => this.deleteEdge(edge));
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {function} [callback]
|
||||
* @returns {string}
|
||||
|
||||
Reference in New Issue
Block a user