Contacts
-
github.com/acidmange
-
t.me/acidmange
-
psotiframe13@gmail.com
-
vk.com/acidmange
-
Russia, Ekaterinburg
Skills
-
HTML
-
CSS
-
Javascript
-
Git
-
PUG
-
SCSS
-
Gulp
-
NodeJS
Languages
-
Russian
native
-
English
upper intermediate
-
EFSET results
About me
Currently I work part-time as a system administrator in a construction company. My goals are to expand my knowledge in computer science and gain a deep understanding of web technologies. I strive to become a competent frontend developer. Thats why I finished a layout designer course on hexlet.io, and now I’m taking the frontend-developer course at rsschool
Courses
-
Hexlet - Layout Design (Completed)
-
Hexlet - Frontend Developer (In progress)
-
Hexlet - JS Backend Developer (In progress)
-
RSSchool - Frontend Developer Pre School (In progress)
Projects
Code Example
Task
convert([]);
// {}
convert([['key', 'value']]);
// { key: 'value' }
convert([['key', 'value'], ['key2', 'value2']]);
// { key: 'value', key2: 'value2' }
convert([
['key', [['key2', 'anotherValue']]],
['key2', 'value2']
]);
// { key: { key2: 'anotherValue' }, key2: 'value2' }
Solution
const convert = (arr) => arr.reduce((acc, [key, value]) => {
if (!Array.isArray(value)) {
acc[key] = value;
} else {
acc[key] = convert(value);
}
return acc;
}, {});
export default convert;