I was just wondering if the DELETE statement is supported by all browsers e.g:
delete myObj;
I just want to开发者_如何学C make 100% sure if all browsers support this or not? Also is there any browser or maybe mobile (cell) phones that do not?
Mozilla's Developer Center provides the following information:
Implemented in: JavaScript 1.2, NES3.0 ECMA Version: ECMA-262
So you can check your target browser against this for an idea of whether it's supported at all or not.
Extreme testing of JavaScript delete operator on different browsers seems to suggest that nearly all major browsers do support it, just not equally well. Furthermore, the author provides an extreme test page for you to experiment with your browser online at http://www.trilancer.com/extreme_delete.html
I would also consider reading the following question for more details on how to property use the delete
operator:
- Deleting Objects in Javascript
To directly answer your question, as far as I am aware, any browser that supports JavaScript supports delete
. I checked and it existed in the specification for ECMAScript 1 (released in 1997) so it's been around for a while now.
精彩评论