Skip to content

Instantly share code, notes, and snippets.

@roneesh
Created March 7, 2017 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roneesh/310c39f82db09def89c1fd98e4364e40 to your computer and use it in GitHub Desktop.
Save roneesh/310c39f82db09def89c1fd98e4364e40 to your computer and use it in GitHub Desktop.
An example of properly formatted code
function underToCamel(underName) {
var camelCaseOutput = "";
var foundunder = false;
for( var i = 0; i < undername.length; i++) {
// undername[i];
if (undername[i] === "_") {
foundunder = true;
} else {
if (foundunder) {
camelcaseoutput += undername[i].toUpperCase();
foundunder = false;
} else {
camelcaseoutput += undername[i];
}
}
}
return camelCaseOutput;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment