var reverse = function( str ){//倒叙的函数 return str.split('').reverse().join(''); //split切割字符串然后转换为数组,reverse是jquery的倒序方法,然后join是将其放到字符串中 }; let a = reverse('1234567'); console.log(a);//a==7654321