字符转为数字 直接让字符变量减 0 let str = '10' let num = '10' - 0 //num是数字 数字转为字符 进行字符串拼接 let num = 10 let str = 10 + '' //str是字符型的