(str)
| 8 | */ |
| 9 | |
| 10 | const lower = (str) => { |
| 11 | if (typeof str !== 'string') { |
| 12 | throw new TypeError('Invalid Input Type') |
| 13 | } |
| 14 | |
| 15 | return str.replace(/[A-Z]/g, (char) => |
| 16 | String.fromCharCode(char.charCodeAt() + 32) |
| 17 | ) |
| 18 | } |
| 19 | |
| 20 | export default lower |