selector-case to camelCase in JavaScript
var camel = 'border-right-color'.replace(/\-(.)/g, function(m, l){return l.toUpperCase()});
DZone Snippets > timmorgan > camelcase
12382 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Tim Morgan http://timmorgan.org
var camel = 'border-right-color'.replace(/\-(.)/g, function(m, l){return l.toUpperCase()});
var selector = 'borderRightColor'.replace(/([A-Z])/g, '-$1').toLowerCase();