Emperor01 / JSlearn

all my practical trainings
0 stars 0 forks source link

so long code xD (function camelize) #12

Open Emperor01 opened 6 years ago

Emperor01 commented 6 years ago

'use strict';

alert( camelize("background-color") );

function camelize(str) { return str.split('-').map( function(item, i) {return (i > 0) ? item[0].toUpperCase() + item.slice(1) : item} ).join(''); }