js-截取字符串的后几位?

var str="abcdef";//截取后2位
str.substring(str.length-2);


输出结果是ef

 

posted @ 2020-09-21 16:45  小白呀白菜  阅读(2876)  评论(0)    收藏  举报