字符串新增方法
startswith() 字符串 以什么开头 返回布尔值
let str="hello world"
let result=str.startsWith("hello")
console.log(result)//true
endswith() 以什么结尾 ,返回布尔值
let str="hello world"
let r1=str.endsWith("ld")
console.log(r1)//true
trim() 清除字符串前后空格的
// 提升用户的体验性 :防止出现空格带来的误操作
let str=" hello world"
console.log(str.trim()=="hello world")//true
ES6新增数据类型
map类型:object对象的升级版 将任意类型的数据做为key
原始object对象:key:value, key只能是字符串格式 现在原始object对象也能使用特殊作为key
let m1=new Map()//创建一个map对象
m1.name="王一"
//可以将特殊的内容,设置key bt1:4
//用set方法进行特殊定义方式
m1.set(bt1,4)
//get方法来获取