Highly doubtful. I've never heard the term 'string indexes' before.
Look for information on objects and properties. In MS JScript, they
are also known as "expando" properties.
I'm guessing you are looking for indexOf and lastIndexOf.
Nope, string index for arrays is not stringmanipulation. For example:
var Stuff= new Array();
Stuff["Yankees"]=10;
Stuff["Red Sox"]=7;
Stuff["Bagels"]=13;
Stuff["Pizza"]=3;
document.write("<BR>Yankees= " + Stuff['Yankees']);
document.write("<BR>Red Sox= " + Stuff['Red Sox']);
document.write("<BR>Bagels= " + Stuff['Bagels']);
document.write("<BR>Pizza= " + Stuff['Pizza']);
If you got that from the book you mentioned before, I'd mildly suggest
throwing that book away before you learn too much from it. What is
misleading about this code is that you've created an array named Stuff
but it doesn't have any items in it. Try adding a
document.write(Stuff.length) on the end and see how many items are in
the array.
The reason you won't find information on 'string indexes' in
references about Arrays is because the concept has nothing to do with
arrays. They are really properties on an object. You can add any
properties you want to a native Javascript object. An Array is simply
a special type of Object -- which is why the above works -- but if an
object is what you want then an object is what you should use, e.g.:
var Stuff= new Object();
Stuff["Yankees"]=10;
Stuff["Red Sox"]=7;
Stuff.Bagels=13;
Stuff.Pizza=3;
Note the different syntax for accessing the property on the last 2
lines. Either style can be used to access a property except if the
property name contains an invalid character (like the space in Red
Sox) in which case you must use the object[property] form.
Regards,
Steve