console.log('123'.charAt(1)); //2
var s = "123";
//s.charAt(1) = "1"; //Uncaught ReferenceError: Invalid left-hand side in assignment
console.log(s);
//字符串比较
var str1 = "aa";
var str2 = "bb";
if(str1 > str2){ //false
console.log("str1 > str2");
}else if(str1<str2){
console.log("str11 < str2");
}else{
console.log("str1 == str2");
}
console.log(str1.localeCompare(str2));
//fromCharCode
var sFromCharCode = String.fromCharCode(65,66,67); //ABC
console.log("sFromCharCode="+sFromCharCode);
console.log(typeof(sFromCharCode)); //string
console