Question:Briefly describe the new, delete and void operators

Answer New operator:All objects must begin with a constructor preceded by the new operator. Example:
var family=new Array("Dad","Mom","Sue","Kris");
Delete operator:The delete operator removes an object property or an array element in a script. Example:
var family=new Array("Dad","Mom","Sue","Kris");
delete family[2];
Void Operator:Void operator is unary and operates on any literal or variable.Usually, we will see this operator as part of an <A> tag in an HTML script. Example:
<a href="javascript:void(0)" onClick="scroll(500,0)">
 

+ Report
Total Preview: 1001
Briefly describe the new, delete and void operators?
Copyright © 2024. Powered by Intellect Software Ltd