In
In determines whether the string on the left or the property that can be converted to a string belongs to the right.
var data = {x:, Y:};//defines direct object
alert ("x" in data);//true, x is an attribute
alert (in data) of data;//false, is the property value of data.
var arr = [,];//defines direct array Object
alert (in arr);//true, the index of ARR array includes,,, is one of his [] attributes.
instanceof
Instanceof wants the instance on the left to be the type of the object on the right.
var date = new Date ();
Alert (date instanceof date);//true
alert (date instanceof Object);//true
alert (date instanceof number); False
var date = [,,];
Alert (date instanceof Array);//true
alert (date instanceof Object);//true
Delete
Delete Deletes an object's properties
var o = {x:, y:};
Alert (delete o.x); True to delete success
alert ("x" in O);//false x is not an O property
var o =;
Alert (delete this.o);//false
y =;
Alert (delete this.y);//true
Summary
Delete is a unary operator, delete cannot delete JavaScript-built global variables, or delete global variables with the Var declaration, but you can delete global variables without the Var declaration.
The above is a small set to introduce the JavaScript will be known will be (vi) Delete in instanceof related knowledge, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!