Advertisement
ReutenkoIvan

camelizeSelector

Sep 11th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const camelize = selector => selector.split('-').map(
  2.   (word, index) => word.length && index - 1
  3.     ? word[0].toUpperCase() + word.slice(1)
  4.     : word
  5.   ).join('');
  6.  
  7. console.log(camelize("-webkit-transition")); // webkitTransition
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement