Is it ok to do this:
var myString="Hello!";
alert(myString[0]); // shows "H" in an alert window
Or should it be done with either charAt(0) or substr(0,1)?
By "is it ok" I mean will it work on most browsers, is there a best practice recommandation that says otherwise etc.
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…