Skip to content

Instantly share code, notes, and snippets.

const emailRegEx = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
@sorinpav
sorinpav / learningResources.md
Created April 24, 2020 11:09
Learning Resources
@sorinpav
sorinpav / arrayMethods.js
Created April 20, 2020 15:49
Array Methods in JS
//*********** Array.prototype.map()**********************//
//executes a callback function on each element of the given array and RETURNS A NEW ARRAY
//.map() DOES create a new array.
const array1 = [1, 4, 9, 16];
// pass a function to map
const map1 = array1.map(x => x * 2);
console.log(map1);
@sorinpav
sorinpav / pureFunctions.js
Last active April 21, 2020 14:34
What a pure function is
const addNumbers(a,b) => return num + a + b;
//Pure functions def: A function which returns the exact same result every time, when given the exact same arguments.
//I.e. a function is NOT pure when the same arguments might give different outputs (i.e. imagine making API calls
//and getting 'num' from above through an API call, which in turn means the num value might be different, since
//the data fetched from the API might be different.
@sorinpav
sorinpav / webdev_online_resources.md
Created August 9, 2019 16:00 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)

Forked from TraversyMedia

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6