String.charAt() 會回傳字串中指定索引位置的字元。
var str = 'JavaScript'; str.charAt(0);
索引從 0 開始,若索引超出範圍,會回傳空字串。
這個方法適合用於逐字處理或簡單字元定位。