Random Stuff

Published October 13, 2007
Advertisement
One:
grouting is messy.

Two:
interesting difference between ie and fox's js implementation #497:

they interpret "superfluous" commas differently.

For example:

var test = ["one","two","three",];
alert(test.length);

will give you 3 in fox, and 4 in ie.

unfortunately for me, i like to do it the lazy way that fox accepts (i tend to organize it more like:

var test =
[
"one",
"two",
"three",
];

doing this allows me to add lines arbitrarily and not care too much about making sure my commas are OK.

of course, i could go to the old way i used to deal with commas in C++ constructor initializers, which had initial commas except on the first line(which had a leading colon) like so:

MyClass::MyClass()
:a(0)
,b(1)
,c(2)
{
}

and this would change the way i do js arrays to:

var test =
["one"
,"two"
,"three"
];

... or i can just load it in fox, convert it to a JSON string, and take the JSON string and make it into a new file.

...or i can just check for superfluous commas.
Previous Entry Google Gadgetized
Next Entry you lucky people
0 likes 1 comments

Comments

johnhattan
Yeah, the easiest solution seems to be to eliminate the trailing commas and get on with your life.
October 14, 2007 09:10 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Music To My Ears

1769 views

Getting There...

2014 views

Guess Chess

1913 views

iPhone JetLag

1865 views

iPhone JetLag

1707 views
Advertisement