substr和substring的区别

其实很简单,substr按字,substring按位:

var str = '我很高兴ho~'
str.substring(str.length - 5, 5) // 高兴h
str.substr(str.length - 5, 5) // 高兴ho~