Skip to Main Content
MooTools 1.3 Cookbook
book

MooTools 1.3 Cookbook

by Jay L Johnston
July 2011
Intermediate to advanced content levelIntermediate to advanced
276 pages
5h 11m
English
Packt Publishing
Content preview from MooTools 1.3 Cookbook

Viewing the members of an OBJECT using three different methods

The contents of an OBJECT differ from those of an ARRAY. Unlike an array, the keys are not incrementing integers. The values in an object have keys that may be strings or integers or even functions.

Getting ready

Create an object like a hash over which to iterate. Though objects may contain functions, only create string and integer elements for this recipe.

var my_object = {
'one':'one',
'two':2,
3:'Trinity'
};

How to do it...

The iteration of an OBJECT varies from that of an ARRAY in two ways. The first is that the Object.each() class method must be used to begin the iteration, as opposed to iterating using dot concatenation syntax directly as is possible with an ARRAY. Secondly, the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Jump Start Web Performance

Jump Start Web Performance

Craig Buckler

Publisher Resources

ISBN: 9781849515689Other