Skip to content

Instantly share code, notes, and snippets.

Array reverse

Even though reverse function exist in Array.prototype.reverse, this example shows how it can be done using reduceRight function of ES5

A Pen by Vlad Bezden on CodePen.

License.

Range Function

Example of custom implementation 'range' function using generator and ES2015 syntax.

A Pen by Vlad Bezden on CodePen.

License.

Inheritance in ES2015

Inheritance example in ES2015. It also provides example on how to use static

A Pen by Vlad Bezden on CodePen.

License.

Proxy Example

Proxy example in ES2015. The only browser that supports this feature is Edge. Babel also doesn't support it

A Pen by Vlad Bezden on CodePen.

License.

Chaining Promises

Example on how to chain Promises. We can pipe the callbacks to queue asynchronous tasks or transform values. Examples are done using expect library

A Pen by Vlad Bezden on CodePen.

License.

Parallel Promises

Example on how to use in parallel Promises and get value after tasks are completed. Example is using expect library for assertion

A Pen by Vlad Bezden on CodePen.

License.

Race Promises

Example on how to use race on Promise. It resolves or reject whenever any of the concurrently running tasks are completed. Example is using expect library for assertion

A Pen by Vlad Bezden on CodePen.

License.

@vlad-bezden
vlad-bezden / Function Composition versus Inheritance.markdown
Created March 21, 2016 14:10
Function Composition versus Inheritance

Even Fibonacci Numbers

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

A Pen by Vlad Bezden on CodePen.