文章目录
Number取绝对值
Math.abs(number)
Number小数四舍五入
number.toFixed(2)
获取字符串的最后一个字符
substr( -1)
let a = "hello";
a.substr(-1);
substring(a.length-1, a.length)
let a = "hello";
a.substring(a.length-1, a.length);
charAt(a.length - 1)
let a = "hello";
(a.charAt(a.length - 1);
slice(-1)
let a = "hello";
a.slice(-1);
split()
let a = "hello";
a.split("")[a.length - 1];
获取字符串的最后一个索引
let a = "hello";
a[a.length-1];
2471

被折叠的 条评论
为什么被折叠?



