πŸ’Š

RegEx: basic functions and groups property

A regular expression is a sequence of characters that specifies a search or a pattern. Some of the functions are exec() and test(), in this js-pill we will see the basic functions and the groups property adventages.

πŸ’Š

Array truncation

This techniques can lock the array’s size, this is very useful to delete some elements of the array based on the number of elements you want to set.

πŸ’Š

Prototype pollution

This pill explain what a Prototype pollution is and how to prevent it

πŸ’Š

Semicolon usage

Semicolons are not required in JavaScript. This is because JavaScript has a feature called Automatic Semicolon Insertion

πŸ’Š

Assert Testing

The assert module provides a set of assertion functions for verifying invariants.

πŸ’Š

Replace all

We're presenting several ways to replace all the occurrences of a substring within a string in Javascript.

πŸ’Š

Async Await iterations

Do you want to make asynchronous request sequentially? Using async await can be tricky. Let's see why.

πŸ’Š

In operator

The `in` operator returns true if the specified property is in the specified object or its prototype chain.

πŸ’Š

Set Default Values

Here are four ways to set a default value for a variable in JavaScript, each one of them with its pros and cons.

πŸ’Š

Map

The `map()` method creates a new array with the results of applying a function on every element of an original array without mutating it.

πŸ’Š

Shuffle an array's elements

Shuffling an array consists on randomly re-arrange the content of that structure. A simple and easy way to shuffle the elements of an array is the following:

πŸ’Š

compose

Compose is a system design principle that allows us to dynamically comibine serveral funcions and returns the resut.

πŸ’Š

Check conditions concurrently

_A system is said to be **concurrent** if it can support two or more actions in progress at the same time. A system is said to be **parallel** if it can support two or more actions executing simultaneously._

πŸ’Š

Creating an array of consecutive numbers

This is a collection of examples on how we can create an <b>array of consecutive numbers from 1 to n</b> in JavaScript, from the classic for loop to the ES6 Array class methods.

πŸ’Š

Clone Javascript Objects

Objects in Javascript are references values, so you can't just copy using assing operator `=`

πŸ’Š

Currying

This is a technique which involves converting a function which takes multiple arguments into a series of smaller cascaded functions which each take a single argument and return a function, except for the last cascaded function which returns the final result.

πŸ’Š

Dedupe arrays

Different ways to remove duplicates from an array

πŸ’Š

Array.prototype.every()

This method tests if all the elements in array meets the condition in the provided function.

πŸ’Š

Merging arrays

If you need to merge two arrays you can use the Array.concat()

πŸ’Š

Reduce

The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value.