Skip to content

@technobuddha > library > Programming > Variables

Function: camelCase()

ts
function camelCase(input: string): string;

Defined in: camel-case.ts:20

Convert an identifier string to a camel case

Parameters

ParameterTypeDescription
inputstringThe identifier string

Returns

string

string in camel case

Example

typescript
camelCase('hello world'); // 'helloWorld'
camelCase('Hello World'); // 'helloWorld'
camelCase('foo_bar-baz'); // 'fooBarBaz'
camelCase('FOO BAR'); // 'fooBar'