views:

209

answers:

2

I was just wondering if the DELETE statement is supported by all browsers e.g:

delete myObj;

I just want to make 100% sure if all browsers support this or not? Also is there any browser or maybe mobile (cell) phones that do not?

The more information the better...

+6  A: 

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:

Jonathan Sampson
+1 - I have never seen anything so extreme!
ChaosPandion
Although this is slightly off topic... it seems that it just tests the browsers speed or performance... however it does explain a lot about the delete so thanks
Val
@Val, I've since updated this solution to explain when it was introduced, how to use it, and how well it works in various browsers.
Jonathan Sampson
@Jonathan I have noticed... thank you btw you have given more information than i would of thought i was going to get :)
Val
Above and beyond the call of duty, sir ;)
Jonathan Sampson
+2  A: 

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.

Rob Van Dam