diff --git a/js-core/homeworks/homework-15/index.html b/js-core/homeworks/homework-15/index.html new file mode 100644 index 0000000..6194bdc --- /dev/null +++ b/js-core/homeworks/homework-15/index.html @@ -0,0 +1,147 @@ + + + + + Home work 15 + + + + + +
+
+

Contacts

+
+
+ +
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameLast nameEmail
ИванПетровIvanPetrov@ec.ua
СергейСергеевSergeiSergeev@ec.ua
ИванИвановIvanIvanov@ec.ua
АлександрАлександровAlexAlex@ec.ua
АлексСмирновAlexSmirnov@ec.ua
СергейВолковVolkovSergey@ec.ua
МарияШараповаMariyaSharapova@ec.ua
АлександрВинникAlexVinnik@ec.ua
ДарийСмирновDariySmirnov@ec.ua
ЕленаЛещенкоElenaLeshenko@ec.ua
ОльгаНовиковаOlgaNovikova@ec.ua
НатальяШемякинаShemyakinaN@ec.ua
АннаДонцоваAnnaDontsova@ec.ua
ВладЯмаVladYama@ec.ua
КираВоробьеваKira1990@ec.ua
ВикторКривенкоViktorKriv@ec.ua
+
+
+ + + + + diff --git a/js-core/homeworks/homework-15/src/main.js b/js-core/homeworks/homework-15/src/main.js new file mode 100644 index 0000000..8884763 --- /dev/null +++ b/js-core/homeworks/homework-15/src/main.js @@ -0,0 +1,75 @@ +/* +TASK 0 +Проверьте что строка содержит все символы от "a" до "z" + solution("wyyga") // false + solution("y") // true + solution("ejuxggfsts") // false + solution("qpwoeirutyalskdjfhgmznxbcv") // true + solution("qqqqqqqqpwoeirutyallskkdjfhgmmznxbcv") // true + solution("0123456789abcdefghijklmnop") // false +*/ + +const solution = str => { + if(str.length<26){ + return false; + } + let letters = 'abcdefghijklmnopqrstuvwxyz'; + for( let i=0; i [1, 2, 3, 4, 5, 10] + [25, 10, [10, [15]]] => [25, 10, 10, 15] + [1, [2, [ {a: "b", c: 'd' }, { c: [1, 2, 5] } ] ] ] => [1, 2, {a: "b"}] + */ + +//#1 arr == [...] flattenedArray = [1] + flatten = [2, [{a: "b"}, { c: 'd' }]] +//#2 arr == [2, [ {a: "b"}, { c: 'd' } ] ] flattenedArray = [2] + flatten == [{a: "b"}, { c: 'd' }] +//#3 arr == [ {a: "b"}, { c: 'd' } ] flattenedArray = [{a: "b"}, { c: 'd' }] +//# +const flatten = arr => { + let res = []; + let subFlatten = arr => { + arr.forEach( value => { + if(!Array.isArray(value)){ + res.push(value); + }else{ + subFlatten(value); + } + }); + } + subFlatten(arr); + return res; +}; + +console.log(flatten([[1,2],[3,[4]],5, 10])); +console.log(flatten([25, 10, [10, [15]]])); +console.log(flatten([1, [2, [ {a: "b", c: 'd' }, { c: [1, 2, 5] } ] ] ])); + + +/* +Виртуализировать таблицу, сделать рендер всей +таблицы через JavaScript. +Второй макет. +https://github.com/aleksandra-maslennikova/telephone-book/blob/master/index.html +Выглядеть должно так же: https://aleksandra-maslennikova.github.io/telephone-book/index.html +*/ \ No newline at end of file