Giter VIP home page Giter VIP logo

kottans-js-2016's People

Contributors

lempiy avatar

Watchers

 avatar  avatar

kottans-js-2016's Issues

Домашка №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

Два задания, сделать одно на выбор

  1. сверстать формочку
    https://dribbble.com/shots/1322677-Checkout-Page/attachments/186093
    аплоад файлов не делать
    тут и табличка (сверху), и radio инпут, и range, к паролю можете прикрутить meter, взять какой-то адекватный плагин (написать самому?) для ввода номер карточки. неправильная форма (или без чекбокса) не сабмититься (кнопка disabled). в идеале, чтобы работало по максимуму без джс
    эту форму, особенно с последним пожеланием, можно долго делать, но я бы ограничил время 8 часами и оценил бы, что получилось
  2. плагин для posthtml
    он должен вырезать бустраповские классы и заменять классы, которые начинаються на js на data- аттрибуты: class=js-smth => data-js=smth

Домашка №0, которую и так все сделали

  1. Установить git / ознакомиться с ним
  2. IDE/editor, ознакомиться с ним.
  3. DevTools - пройти на CodeSchool (http://discover-devtools.codeschool.com/).
  4. Github - завести репозитарий для домашек.
  5. GitBranching: http://pcottle.github.io/learnGitBranching/ пройти Main, забросить скриншот в гитхаб, сюда запостить ссылку

Фидбек на домашку №2

const arrayOfBootstrap = bootstrap.split('\n.'); - first line would not match this and you'll end up with ".navbar"
Possible workarounds:

  1. using editor and multiple cursors of find+replace to remove first .
  2. using split + map / filter
    classes.split(/\n/m).map((i) => i.replace(/^\./, ''))
    classes.split(/\.([\w\d\-]+)\n?/).filter(i => i)
  3. 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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.