获取字符串的最后一位
var str = 'hello'; String.prototype.lastValue = function(){ return this.charAt(this.length-1); }; alert( str.lastValue() ); //o
var str = 'hello'; String.prototype.lastValue = function(){ return this.charAt(this.length-1); }; alert( str.lastValue() ); //o