Most cases where you find String.substr() in the wild are to check if a given string begins with a certain other string. Be it checking for a prefix or sorting out zipcodes that begin with certain numbers. And because code readability is a good thing (really, it is important), it would be nice to have a String.beginsWith() method. Or, because of dojo love, a dojo.string.beginsWith() method.
Consider the following code:
var nearbyZipcodes = dojo.filter(givenZipcodes,function(zipcode){
return dojo.string.beginsWith(zipcode,'12');
});

