Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overriding Javascript's delete operator?

Tags:

javascript

Is there a way to override Javascript's delete operator to some custom function.

I've used Object.defineProperty(obj, "prop", { get: ..., set: ... }) to override the default getter and setter but I also need to get the delete event.

like image 670
user1081479 Avatar asked Oct 09 '22 07:10

user1081479


2 Answers

No, you can not override JavaScript's delete operator.

like image 198
alex Avatar answered Oct 13 '22 11:10

alex


you can see an interesting blog on Why not Operator Overloading in JavaScript? here

like image 22
Hemant Metalia Avatar answered Oct 13 '22 09:10

Hemant Metalia