Given a string representing constant name (upper case words
separated by underscore eg FOO_BAR
) implement a function which
converts it into variable name (eg. fooBar
):
Challenge | Solution |
decapitalizeConst("FOO") // foo
decapitalizeConst("FOO_BAR") // fooBar
decapitalizeConst("__FOO_BAR_BAZ") // fooBarBaz