coderfee
coderfee
```javascript function substrCount(str, target) { let count = 0; while (str.includes(target)) { const index = str.indexOf(target); count++; str = str.substring(index + target.length); } return count; } ```
```javascript function toCamelCase(str) { if (typeof str !== 'string') { return str; } return str .split('_') .map(item => item.charAt(0).toUpperCase() + item.substr(1, item.length)) .join(''); } ```
```javascript function params() { const search = window.location.search; search = search.substr(1, search.length); const res = {}; if (!search) return res; search.split('&').map(item => { const [key, value] = item.split('='); res[key] =...