This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Расширение объектных литералов | |
let name = "Alex" | |
let soname = "Zel" | |
let obj = {name, soname} | |
console.log(obj) | |
// Также можно создать метод | |
let fullName = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function greet(lang) { | |
return langs[lang]||langs['english']; | |
} | |
var langs = { | |
'english': 'Welcome', | |
'czech': 'Vitejte', | |
'danish': 'Velkomst', | |
'dutch': 'Welkom', | |
'estonian': 'Tere tulemast', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App extends React.Component { | |
state = { | |
todolists: [], | |
}; | |
newTodoListId = 0; | |
addTodoList = (title) => { | |
let newTodoList = {id: this.newTodoListId, title: title}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class AddNewItemForm extends React.Component { | |
constructor() { | |
super(); | |
} | |
state = { | |
error: false, | |
inputValue: '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | |
# dependencies | |
/node_modules | |
/.pnp | |
.pnp.js | |
# testing | |
/coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.diff = function(a) { | |
return this.filter(function(i) {return a.indexOf(i) < 0;}); | |
}; | |
//////////////////// | |
// Examples | |
//////////////////// | |
[1,2,3,4,5,6].diff( [3,4,5] ); | |
// => [1, 2, 6] |
NewerOlder