Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: map & RegExp solution in Creative category for Conversion into CamelCase by --Serial_Sniper--
import assert from "assert";
function toCamelCase(name: string): string { return name.split("_").map(x=>x.replace(/^\w/, (c) => c.toUpperCase())).join("")
}
console.log('Example:');
console.log(toCamelCase('my_function_name'));
// These "asserts" are used for self-checking
assert.equal(toCamelCase('my_function_name'), 'MyFunctionName');
assert.equal(toCamelCase('i_phone'), 'IPhone');
console.log("Coding complete? Click 'Check' to earn cool rewards!");
June 27, 2020