Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Defining Constants

Thread Tools

Defining Constants

Gene Wirchenko
Posts: n/a
Dear JavaScripters:

I want to include some constants for use with my date type. This
is related to my question about toString() parameters.

Should I do

1) Defined in Object

function JustDate()


2) Defined Outside Object


function JustDate()

Does it really matter?


Gene Wirchenko
Reply With Quote
Dr J R Stockton
Posts: n/a
In comp.lang.javascript message <c8nke7t4hcpkapltpsntad1d55k7le2q8u@4ax.
com>, Thu, 15 Dec 2011 14:42:00, Gene Wirchenko <(E-Mail Removed)> posted:

>1) Defined in Object
> function JustDate()
> {
> this.JDFmtISO8601=1;
> this.JDFmtIMA=2;

Avoid "JD" in this context; it already has an established meaning in
connection with dates.

Consider also

var GWC = { JDFmtISO8601 : 1 , JDFmtIMA : 2 , ... }

(c) John Stockton, Surrey, UK. ? Turnpike v6.05 MIME.
Web <> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
defining or not defining destructors johny smith C++ 8 07-02-2004 08:51 AM
Defining constants in classes Joe C++ 29 03-04-2004 03:03 PM
Defining a real valued input in the entity VHDL 1 02-04-2004 08:15 AM
Defining constants in global scope Thomas Sondergaard Ruby 2 09-24-2003 06:02 AM
Defining/declaring constants in Python Sriram Chadalavada Python 2 07-29-2003 11:56 AM