JSFiddle - React, Tailwind, and code Playground

JavaScript

//For those who'd rather not mess with natives
toCamelCase = function(string){
    return string.replace(/[_\-]([^_\-])/g, function($0,$1){return $1.toUpperCase();});
}
toUpperCamelCase = function(string){
    return string.charAt(0).toUpperCase() + toCamelCase(string.substring(1));
}
console.log(toCamelCase('something-like-this-1'));
console.log(toCamelCase('something_like_this_2'));
console.log(toUpperCamelCase('something-like-this-3'));
console.log(toUpperCamelCase('something_like_this_4'));

//Or for those comfortable extending natives
if (!String.prototype.toCamelCase)String.prototype.toCamelCase = function(){
    return this.replace(/[_\-]([^_\-])/g, function($0,$1){return $1.toUpperCase();});
};
if (!String.prototype.toUpperCamelCase)String.prototype.toUpperCamelCase = function(){
    return this.charAt(0).toUpperCase() + this.substring(1).toCamelCase();
};
console.log('something-like-this-5'.toCamelCase());
console.log('something_like_this_6'.toCamelCase());
console.log('something-like-this-7'.toUpperCamelCase());
console.log('something_like_this_8'.toUpperCamelCase());