Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Conversion into CamelCase solution in Uncategorized category for Conversion into CamelCase by vvm70
import assert from "assert";
function toCamelCase(name: string): string {
return name.split('_').map(x => x[0].toUpperCase() + x.slice(1)).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!");
July 6, 2020
Comments: