Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript DELETE statement. Query

Tags:

javascript

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?

like image 447
Val Avatar asked Dec 10 '22 17:12

Val


2 Answers

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
like image 137
Sampson Avatar answered Dec 28 '22 01:12

Sampson


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.

like image 39
Rob Van Dam Avatar answered Dec 28 '22 00:12

Rob Van Dam