Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is this storage container called? 1

Status
Not open for further replies.
Dec 8, 2003
17,047
GB

I've been using this method of storage for some time now, but can't remember where I found out about it:

Code:
var newRecord = { left: 0, top: 0 };

What I want to know is what is it called? I've always called the structure a record, but is this the correct terminology?

You can access the 'fields' in the 'record' using either dot notation (newRecord.left) or string notation (newRecord['left']).

BTW... For anyone interesting in an example that uses this storage method, check out my post on dynamic table sorting:

thread216-752635

Dan
 
it's just shorthand for an object, equivalent to

function NewRecord() {
this.left = 0;
this.top = 0;
}

var newRecord = new NewRecord();


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 

Excellent - Thanks for that... I couldn't find any reference to that shorthand method!

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top