Main Menu

Categories

Subscribe

The In Operator in JavaScript

April 6th, 2009

The In Operator expects a left-side that is or can be converted to a string. it expects a right-side operand that is an object or array. It evaluates to true if the left-side value is the name of a property of the right-side object.

var names = new Array("Keith", "Aoife", "Sasha");

delete trees[2]; // Delete index number 3

3 in name; // returns false

No Comments

Leave a Reply