MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / lower

Function lower

String/Lower.js:10–18  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

8 */
9
10const 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
20export default lower

Callers 1

Lower.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected