renovations
This commit is contained in:
parent
4b8b168fd2
commit
c7d4c7e3ff
172 changed files with 869 additions and 244 deletions
20
1-js/4-data-structures/8-array-methods/2-camelcase/task.md
Normal file
20
1-js/4-data-structures/8-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