0
点赞
收藏
分享

微信扫一扫

字符串方法 es6 230223

紫荆峰 2023-02-23 阅读 152

判开头与结尾

let name = "天龙八部.mp4"

let b = name.endsWith(".mp4")
console.log(b)

let b2 = name.startsWith("天龙")
console.log(b2)


重复数据

让符号重复20次

let s = "*".repeat(20)
console.log(s)

举报

相关推荐

0 条评论