糖糖啊

Results 3 comments of 糖糖啊

```js function tranStr(str) { if (typeof str !== 'string') return '' const splitStr = str.split('') return splitStr.reduce((res, s) => { if (/[a-z]/g.test(s)) { res += s.toLocaleUpperCase() } else if (/[A-Z]/g.test(s))...

```js /** * 把一个字符串的大小写取反(大写变小写小写变大写),例如 ’AbC' 变成 'aBc' * @param {*} str */ function tranStr2(str) { if (typeof str !== 'string') return str return str.replace(/[a-zA-Z]/g, function(s) { return /[a-z]/g.test(s) ? s.toLocaleUpperCase()...

```js const reverse = function (x) { const max = Math.pow(2, 31) let b = 0 while (x) { b = b * 10 + (x % 10) x =...