This project is archived and is in readonly mode.

#1172 ✓duplicate
mediavrog

Mootools Docs Error: Object.keyOf

Reported by mediavrog | February 7th, 2011 @ 07:34 PM | in 1.3.1 (closed)

Function: Object.keyOf

Returns the key of the specified value. Synonymous with Array:indexOf.

Syntax:
________________________________________________

var key = Object.keyOf(object);

should be

var key = Object.keyOf(object, item);

________________________________________________

Arguments:

object - (object) The object.
item - (mixed) The item to search for in the object.
Returns:

(string) If the object has a the specified item in it, returns the key of that item. (boolean) Otherwise, returns false. Examples:

var myObject = {a: 'one', b: 'two', c: 3};
Object.keyOf(myObject,'two'); // returns 'b'
Object.keyOf(myObject,3); // returns 'c'
Object.keyOf(myObject,'four'); // returns false

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages