update
This commit is contained in:
parent
962caebbb7
commit
87bf53d076
1825 changed files with 94929 additions and 0 deletions
20
1-js/4-data-structures/7-array-methods/2-camelcase/task.md
Normal file
20
1-js/4-data-structures/7-array-methods/2-camelcase/task.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Перевести текст вида border-left-width в borderLeftWidth
|
||||
|
||||
[importance 3]
|
||||
|
||||
Напишите функцию `camelize(str)`, которая преобразует строки вида "my-short-string" в "myShortString".
|
||||
|
||||
То есть, дефисы удаляются, а все слова после них получают заглавную букву.
|
||||
|
||||
Например:
|
||||
|
||||
```js
|
||||
camelize("background-color") == 'backgroundColor';
|
||||
camelize("list-style-image") == 'listStyleImage';
|
||||
camelize("-webkit-transition") == 'WebkitTransition';
|
||||
```
|
||||
|
||||
Такая функция полезна при работе с CSS.
|
||||
|
||||
P.S. Вам пригодятся методы строк `charAt`, `split` и `toUpperCase`.
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue