camelize
camelize converts a string into camelCase. It lowercases the first word, capitalises the first letter of every subsequent word and strips out any whitespace.
This is useful when you need to turn human-readable labels or hyphenated/spaced strings into valid JavaScript property or key names.
Usage examples
Basic
- 2.0 Build
- 1.0 Build
window.BAO.utils.camelize('hello world') // 'helloWorld'
window.BAO.utils.camelize('Add to cart') // 'addToCart'
camelize('hello world') // 'helloWorld'
camelize('Add to cart') // 'addToCart'