1.关于字符串的遍历
es6中字符串的遍历
var s="hdfghdsgfjhgfugjf"
for(let codepoint of s){
console.log(codepoint)
}
2.字符串的charAt方法:
var s="hdfghdsgfjhgfugjf"
console.log(s.charAt(0)) //"h"输入的是阿拉伯数字 返回的是在这个位置上面的字符串
1.关于字符串的遍历
es6中字符串的遍历
var s="hdfghdsgfjhgfugjf"
for(let codepoint of s){
console.log(codepoint)
}
2.字符串的charAt方法:
var s="hdfghdsgfjhgfugjf"
console.log(s.charAt(0)) //"h"输入的是阿拉伯数字 返回的是在这个位置上面的字符串
本文标题:一些关于es6的学习
本文链接:https://www.haomeiwen.com/subject/jywjpftx.html
网友评论