js截取字符串的后几位数

代码如下:

var str="abcdefghhhh";//截取后4位
str.substring(str.length-4);
原文地址:https://www.cnblogs.com/Mrrabbit/p/9230002.html