kottans-js-2016's People
kottans-js-2016's Issues
Домашнее задание по промисам
Написать Promise.map
, Promise.some
и Promise.reduce
. Должно работать как в доках блуберда: http://bluebirdjs.com/docs/api-reference.html. Тесты: https://github.com/petkaantonov/bluebird/tree/master/test/mocha
Промис нужно сабклассить. Promise.all
не юзать. Брать конструктор промиса из this
Домашнее задание по тестированию
https://github.com/timoxley/functional-javascript-workshop - complete 'Function Spies' exercise.
Investigate following questions:
- What are stubs, mocks? What is the difference?
- What is the difference between TDD and BDD?
Read about several test frameworks / setups, pick one (qunit, jasmine, mocha, ava, tape).
Do Kata #1 using it.
Домашка №4
написать deepAssign, который работает ровно так же, как и Object.assign (порядок ключей, проверка на enumerable, проверяет на != null etc), но хэндлит nested объекты
правильно проверяет на объект, умеет работать с сабклассами
то есть new obj.constructor, а не []/{}
бонусные поинты: хэндлить даты/регэкспы/мэпы/сэты
https://github.com/shvaikalesh/polyfill-object/blob/master/assign.js
реализация Object.assign, ваш тоже должен работать с Object.create(null)
должно работать синхронно и в рамках ecmascript. то есть structured clone не юзать! и без JSON
Домашка №3
Сверстать формочку
https://dribbble.com/shots/1322677-Checkout-Page/attachments/186093
аплоад файлов не делать
тут и табличка (сверху), и radio
инпут, и range
, к паролю можете прикрутить meter
, взять какой-то адекватный плагин (написать самому?) для ввода номер карточки. неправильная форма (или без чекбокса) не сабмититься (кнопка disabled). в идеале, чтобы работало по максимуму без джс.
Очень желательно воспользоваться scss/less/postcss/stylus, применить flexbox, autoprefixer
Домашка №1, HTML
Разметить эту страницу: https://habrahabr.ru/post/244929/
от вас ожидаеться .html
файл с семантичной разметкой, без css/js
крупные части контента копипастить не стоит (саму статью, там h*
/p
/code
-- все просто), а вот остальное -- нужно
как должно выглядить
<!doctype html>
<html lang=ru>
<meta charset=utf-8>
<title>Habrahabr.ru</title>
<header>
<ul>
<li><a href=...>TM Feed</a>
<li><a>Хабрахабр</a>
</ul>```
Домашка №2
Два задания, сделать одно на выбор
- сверстать формочку
https://dribbble.com/shots/1322677-Checkout-Page/attachments/186093
аплоад файлов не делать
тут и табличка (сверху), иradio
инпут, иrange
, к паролю можете прикрутитьmeter
, взять какой-то адекватный плагин (написать самому?) для ввода номер карточки. неправильная форма (или без чекбокса) не сабмититься (кнопка disabled). в идеале, чтобы работало по максимуму без джс
эту форму, особенно с последним пожеланием, можно долго делать, но я бы ограничил время 8 часами и оценил бы, что получилось - плагин для posthtml
он должен вырезать бустраповские классы и заменять классы, которые начинаються наjs
наdata
- аттрибуты:class=js-smth
=>data-js=smth
Домашка №0, которую и так все сделали
- Установить git / ознакомиться с ним
- IDE/editor, ознакомиться с ним.
- DevTools - пройти на CodeSchool (http://discover-devtools.codeschool.com/).
- Github - завести репозитарий для домашек.
- GitBranching: http://pcottle.github.io/learnGitBranching/ пройти Main, забросить скриншот в гитхаб, сюда запостить ссылку
Домашнее задание по Node
Фидбек на домашку №2
const arrayOfBootstrap = bootstrap.split('\n.');
- first line would not match this and you'll end up with ".navbar"
Possible workarounds:
- using editor and multiple cursors of find+replace to remove first .
- using split + map / filter
classes.split(/\n/m).map((i) => i.replace(/^\./, ''))
classes.split(/\.([\w\d\-]+)\n?/).filter(i => i)
- being a smart and stubborn guy and using single split with regexp, keeping in mind that:
If separator is a regular expression that contains capturing parentheses, then each time separator is matched, the results (including any undefined results) of the capturing parentheses are spliced into the output array.
vendor requires/imports (like require('posthtml')
) would usually/by some conventions reside at the top of your file.
arrayOfBootstrap.indexOf(item) <> 0
-> Array#includes
if (too) {
if(much) {
if(nesting) {
} else {
}
} else {
if(Icannoteven) {
} else {
}
}
}
Top level if could be replaced with guard condition for negative case if (arrayOfBootstrap.includes(class)) {return}
Deepest level if-else could be replaced with ?:
, something like
let someGoodVarNameGoesHere = item.replace('js-', '')
jsData += jsData.length > 0 ? ' ' + someGoodVarNameGoesHere : someGoodVarNameGoesHere
Also, you could add whitespace in any case each iteration, but just do final .trim()
.
There's a possibly good read for you regarding refactoring conditionals. Martin Fowler chapter 11 or smth.
arrayOfClasses.forEach(MAINLOGICGOESHERE)
This is a bit tangled code which performs multiple operations, might be better to have those functions separated.
Also, pattern with having accumulator, modifying it on every iteration, returning accumulator is basically Array#reduce.
Other possible improvement - why work with strings and concatenate, if you could form array of final classes and just do .join(' ')
on those?
And one way to get a subset of array from larger array would be Array#filter
, for example.
node.attrs['class'] = false;
- why do you have this assignment?
String.prototype.startsWith = function(letters)
{
return(this.indexOf(letters) == 0);
};
this part has spaces, although other parts are using tabs for identation. Any of these are fine, but be consistent.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.