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] |
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
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
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
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
//Расширение объектных литералов | |
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
import sound from "./source/filename.mp3" | |
let audio = new Audio(sound); | |
audio.play(); |
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
// Create interfaces for type | |
interface Urls { | |
small: string; | |
regular: string; | |
} | |
export interface PictureDate { | |
id: string; | |
urls: Urls; |
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
(change)="showOptions($event)" | |
showOptions(event:MatCheckboxChange): void { | |
console.log(event.checked); | |
} |
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
// component for output data | |
import {Component, OnInit} from '@angular/core'; | |
import {PictureDate, PictureService} from '../../services/picture.service'; | |
import {StateService} from '../../services/state.service'; | |
@Component({ | |
selector: 'app-home-page', | |
templateUrl: './home-page.component.html', |
OlderNewer