您当前的位置: 首页 >  ar

暂无认证

  • 1浏览

    0关注

    93637博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

js的join split startsWith endsWith

发布时间:2020-09-23 01:09:33 ,浏览量:1

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <script type="text/javascript"> // 1.字符串切割 let arr=[1,3,5]; let a=arr.join("|"); console.log(a); let b=a.split("|"); console.log(b); // 2.判断是否以指定字符串开头 ES6 let str = "http://www.it666.com"; let w=str.startsWith("http"); console.log(w); // 3.判断是否以指定字符串结尾 ES6 let str1= "lnj.jpg"; let r=str1.endsWith("png"); console.log(r); // 4.字符串模板 ES6 let vv=`www.it666.com`; console.log(vv); let cc=`
		
  • aaa
  • bbb
  • ccc
`; console.log(cc); let name = "lnj"; let age = 34; let ff=`${name},${age}`; console.log(ff); </script> </body> </html>
关注
打赏
1655258400
查看更多评论
立即登录/注册

微信扫码登录

0.0500s