Format your strings to Camel Case with Lodash

node v14.20.1
version: 1.0.0
These examples show you how to format any string to camelCase using Lodash's `_.camelCase` function.
const _ = require("lodash");
It works out-of-the-box with dashes and underscores:
However, you may not have the desired result with weird casings in you string:
To fix this, ensure to format your string to lower case **before** applying the `camelcase` function:
Note that the function works smoothly with dot notation (for example, flattened object keys):

no comments

    sign in to comment