Skip to content

Instantly share code, notes, and snippets.

View ivankisyov's full-sized avatar
🤓
Console Logger, Level 4

Ivanman ivankisyov

🤓
Console Logger, Level 4
View GitHub Profile
@ivankisyov
ivankisyov / what-is-instance-in-js.md
Created December 24, 2018 11:37
What is an Instance in JS?
@ivankisyov
ivankisyov / what-is-dunder-proto.md
Last active November 14, 2022 07:18
What is dunder proto in JS

What is dunder proto in JS

dunder proto === __proto__

Every object in JS has this property.

It points back to the prototype object of the constructor function that created that object.

Only Object.prototype.__proto__ === null

@ivankisyov
ivankisyov / prototype-property-js.md
Last active December 24, 2018 11:33
Prototype Property in JS

Prototype Property in JS

When a new function is created a new property is added to it. That property is named prototype. It's an object and initially has two properties:

  • constructor: which points to the function itself;
  • __proto__
@ivankisyov
ivankisyov / autoboxing-js.md
Last active December 24, 2018 09:43
Autoboxing in JS

Autoboxing in JS

// calling String function like this
// will try to create a primitive value of type string from the argument which 
// is passed to the String function
String("chair") // the result is "chair"
@ivankisyov
ivankisyov / constructor-functions-js.md
Last active December 25, 2018 16:06
Constructor Functions in JS

Constructor Functions in JS

If you have several objects that share the same implementation, you can use a constructor function to create them.

Any function can be a constructor function as long as it is invoked using the new keyword

function createSillyExample() {}

const objectCreatedFromSillyExample = new createSillyExample();
@ivankisyov
ivankisyov / typescript.md
Last active December 26, 2018 12:39
Typescript

Typescript

Installation

Global installation

npm i -g typescript
@ivankisyov
ivankisyov / functional_programming.md
Last active December 30, 2018 22:17
Functional Programming

Functional Programming

Pure Functions

  • a fn which uses only its arguments and/or local variables to compute its result
  • a fn which does not cause side effects

Todo: Function Composition

Higher Order Function

@ivankisyov
ivankisyov / tips-building-apis.md
Created December 9, 2018 12:32
Tips for building APIs
@ivankisyov
ivankisyov / regex.md
Created December 9, 2018 12:18
Regular Expressions
@ivankisyov
ivankisyov / testing_in_node.md
Last active December 15, 2021 21:45
[Node] Testing

Testing with Jest

npm i --save-dev jest

package.json

{