Menu

Objects

James Stortz

Working with Objects in JavaScript

new Object();

Objects

| OVERVIEW

Objects should be simple and universal, on.js makes everything possible in one easy step.

COUNT

Properties

var myObject = 
{   'abc' : 123
,   'xyz' : 789
};

('count')[on](myObject)();      //returns total # of properties [2]

Property Names as Indices

var myObject = 
{   'abc' : 123
,   'xyz' : 789
};

('count')[on](myObject)(1);     //returns property name ['xyz'] at index [1]

Property Values at Indices

var myObject = 
{   'abc' : 123
,   'xyz' : 789
};

('count')[on](myObject)(1,true);    //returns property value [789] at index [1]

on.js

return true;

A JavaScript Library


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.