diff --git a/README.md b/README.md index b102d2f61..492bcdfd4 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,7 @@ _30s.average(1, 2, 3); * [`isAfterDate`](#isafterdate) * [`isBeforeDate`](#isbeforedate) * [`isSameDate`](#issamedate) +* [`isWeekday`](#isweekday) * [`maxDate`](#maxdate) * [`minDate`](#mindate) * [`tomorrow`](#tomorrow) @@ -679,7 +680,7 @@ const sum = pipeAsyncFunctions( x => x + 3, async x => (await x) + 4 ); -(async() => { +(async () => { console.log(await sum(5)); // 15 (after one second) })(); ``` @@ -2329,9 +2330,9 @@ The `func` is invoked with three arguments (`value, index, array`). const remove = (arr, func) => Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => { - arr.splice(arr.indexOf(val), 1); - return acc.concat(val); - }, []) + arr.splice(arr.indexOf(val), 1); + return acc.concat(val); + }, []) : []; ``` @@ -4500,6 +4501,30 @@ isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20)); // true
[⬆ Back to top](#contents) +### isWeekday + +Results in a boolean representation of a specific date. + +Pass the specific date object firstly. +Use `Date.getDay()` to check weekday then return a boolean. + +```js +const isWeekday = (t = new Date()) => { + return t.getDay() >= 1 && t.getDay() <= 5; +}; +``` + +
+Examples + +```js +isWeekday(); // true (if current date is 2019-07-19) +``` + +
+ +
[⬆ Back to top](#contents) + ### maxDate Returns the maximum of the given dates. @@ -4764,6 +4789,7 @@ const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]); + const lengthIs4 = checkProp(l => l === 4, 'length'); lengthIs4([]); // false lengthIs4([1,2,3,4]); // true @@ -5640,8 +5666,8 @@ Throws an exception if `n` is a negative number. const factorial = n => n < 0 ? (() => { - throw new TypeError('Negative numbers are not allowed!'); - })() + throw new TypeError('Negative numbers are not allowed!'); + })() : n <= 1 ? 1 : n * factorial(n - 1); @@ -6978,11 +7004,11 @@ const deepMapKeys = (obj, f) => ? obj.map(val => deepMapKeys(val, f)) : typeof obj === 'object' ? Object.keys(obj).reduce((acc, current) => { - const val = obj[current]; - acc[f(current)] = + const val = obj[current]; + acc[f(current)] = val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val); - return acc; - }, {}) + return acc; + }, {}) : obj; ``` @@ -7056,9 +7082,9 @@ const dig = (obj, target) => target in obj ? obj[target] : Object.values(obj).reduce((acc, val) => { - if (acc !== undefined) return acc; - if (typeof val === 'object') return dig(val, target); - }, undefined); + if (acc !== undefined) return acc; + if (typeof val === 'object') return dig(val, target); + }, undefined); ```
diff --git a/docs/about.html b/docs/about.html index 87edbc594..97fbebc8e 100644 --- a/docs/about.html +++ b/docs/about.html @@ -288,6 +288,7 @@
  • isAfterDate
  • isBeforeDate
  • isSameDate
  • +
  • isWeekday
  • maxDate
  • minDate
  • tomorrow
  • diff --git a/docs/adapter.html b/docs/adapter.html index 1872ab467..c0da85b49 100644 --- a/docs/adapter.html +++ b/docs/adapter.html @@ -93,7 +93,7 @@ },1700); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.prototype.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Adapter

    ary

    Creates a function that accepts up to n arguments, ignoring any additional arguments.

    Call the provided function, fn, with up to n arguments, using Array.prototype.slice(0,n) and the spread operator (...).

    const ary = (fn, n) => (...args) => fn(...args.slice(0, n));
     
    const firstTwoMax = ary(Math.max, 2);
     [[2, 6, 'a'], [8, 4, 6], [10]].map(x => firstTwoMax(...x)); // [6, 8, 10]
     

    call

    Given a key and a set of arguments, call them when given a context. Primarily useful in composition.

    Use a closure to call a stored key with stored arguments.

    const call = (key, ...args) => context => context[key](...args);
    @@ -133,7 +133,7 @@ Object.assig
       x => x + 3,
       async x => (await x) + 4
     );
    -(async() => {
    +(async () => {
       console.log(await sum(5)); // 15 (after one second)
     })();
     

    Recommended Resource - ES6: The Right Parts

    Learn new ES6 JavaScript language features like arrow function, destructuring, generators & more to write cleaner and more productive, readable programs.

    pipeFunctions

    Performs left-to-right function composition.

    Use Array.prototype.reduce() with the spread operator (...) to perform left-to-right function composition. The first (leftmost) function can accept one or more arguments; the remaining functions must be unary.

    const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
    diff --git a/docs/archive.html b/docs/archive.html
    index 796b811de..cf8bbe8be 100644
    --- a/docs/archive.html
    +++ b/docs/archive.html
    @@ -76,7 +76,7 @@
                 }, 1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Snippets Archive

    These snippets, while useful and interesting, didn't quite make it into the repository due to either having very specific use-cases or being outdated. However we felt like they might still be useful to some readers, so here they are.


    binarySearch

    Use recursion. Similar to Array.prototype.indexOf() that finds the index of a value within an array. The difference being this operation only works with sorted arrays which offers a major performance boost due to it's logarithmic nature when compared to a linear search or Array.prototype.indexOf().

    Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search is less than the item in the middle of the interval, recurse into the lower half. Otherwise recurse into the upper half. Repeatedly recurse until the value is found which is the mid or you've recursed to a point that is greater than the length which means the value doesn't exist and return -1.

    const binarySearch = (arr, val, start = 0, end = arr.length - 1) => {
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Snippets Archive

    These snippets, while useful and interesting, didn't quite make it into the repository due to either having very specific use-cases or being outdated. However we felt like they might still be useful to some readers, so here they are.


    binarySearch

    Use recursion. Similar to Array.prototype.indexOf() that finds the index of a value within an array. The difference being this operation only works with sorted arrays which offers a major performance boost due to it's logarithmic nature when compared to a linear search or Array.prototype.indexOf().

    Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search is less than the item in the middle of the interval, recurse into the lower half. Otherwise recurse into the upper half. Repeatedly recurse until the value is found which is the mid or you've recursed to a point that is greater than the length which means the value doesn't exist and return -1.

    const binarySearch = (arr, val, start = 0, end = arr.length - 1) => {
       if (start > end) return -1;
       const mid = Math.floor((start + end) / 2);
       if (arr[mid] > val) return binarySearch(arr, val, start, mid - 1);
    diff --git a/docs/browser.html b/docs/browser.html
    index 52d05d463..f4d5c39c0 100644
    --- a/docs/browser.html
    +++ b/docs/browser.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Browser

    arrayToHtmlList

    Converts the given array elements into <li> tags and appends them to the list of the given id.

    Use Array.prototype.map(), document.querySelector(), and an anonymous inner closure to create a list of html tags.

    const arrayToHtmlList = (arr, listID) =>
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Browser

    arrayToHtmlList

    Converts the given array elements into <li> tags and appends them to the list of the given id.

    Use Array.prototype.map(), document.querySelector(), and an anonymous inner closure to create a list of html tags.

    const arrayToHtmlList = (arr, listID) =>
       (el => (
         (el = document.querySelector('#' + listID)),
         (el.innerHTML += arr.map(item => `<li>${item}</li>`).join(''))
    diff --git a/docs/contributing.html b/docs/contributing.html
    index 62e89c93b..bf98142c0 100644
    --- a/docs/contributing.html
    +++ b/docs/contributing.html
    @@ -288,6 +288,7 @@
     
  • isAfterDate
  • isBeforeDate
  • isSameDate
  • +
  • isWeekday
  • maxDate
  • minDate
  • tomorrow
  • diff --git a/docs/date.html b/docs/date.html index 54ec98a58..a511157aa 100644 --- a/docs/date.html +++ b/docs/date.html @@ -93,7 +93,7 @@ },1700); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Date

    dayOfYear

    Gets the day of the year from a Date object.

    Use new Date() and Date.prototype.getFullYear() to get the first day of the year as a Date object, subtract it from the provided date and divide with the milliseconds in each day to get the result. Use Math.floor() to appropriately round the resulting day count to an integer.

    const dayOfYear = date =>
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Date

    dayOfYear

    Gets the day of the year from a Date object.

    Use new Date() and Date.prototype.getFullYear() to get the first day of the year as a Date object, subtract it from the provided date and divide with the milliseconds in each day to get the result. Use Math.floor() to appropriately round the resulting day count to an integer.

    const dayOfYear = date =>
       Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 1000 / 60 / 60 / 24);
     
    dayOfYear(new Date()); // 272
     

    formatDuration

    Returns the human readable format of the given number of milliseconds.

    Divide ms with the appropriate values to obtain the appropriate values for day, hour, minute, second and millisecond. Use Object.entries() with Array.prototype.filter() to keep only non-zero values. Use Array.prototype.map() to create the string for each value, pluralizing appropriately. Use String.prototype.join(', ') to combine the values into a string.

    const formatDuration = ms => {
    @@ -133,8 +133,12 @@
     
    isAfterDate(new Date(2010, 10, 21), new Date(2010, 10, 20)); // true
     

    isBeforeDate

    Check if a date is before another date.

    Use the less than operator (<) to check if the first date comes before the second one.

    const isBeforeDate = (dateA, dateB) => dateA < dateB;
     
    isBeforeDate(new Date(2010, 10, 20), new Date(2010, 10, 21)); // true
    -

    Recommended Resource - JavaScript: The Hard Parts

    Take your JavaScript to the next level. Gain an understanding of callbacks, higher order functions, closure, asynchronous and object-oriented JavaScript!

    isSameDate

    Check if a date is the same as another date.

    Use Date.prototype.toISOString() and strict equality checking (===) to check if the first date is the same as the second one.

    const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString();
    +

    isSameDate

    Check if a date is the same as another date.

    Use Date.prototype.toISOString() and strict equality checking (===) to check if the first date is the same as the second one.

    const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString();
     
    isSameDate(new Date(2010, 10, 20), new Date(2010, 10, 20)); // true
    +

    Recommended Resource - JavaScript: The Hard Parts

    Take your JavaScript to the next level. Gain an understanding of callbacks, higher order functions, closure, asynchronous and object-oriented JavaScript!

    isWeekday

    Results in a boolean representation of a specific date.

    Pass the specific date object firstly. Use Date.getDay() to check weekday then return a boolean.

    const isWeekday = (t = new Date()) => {
    +  return t.getDay() >= 1 && t.getDay() <= 5;
    +};
    +
    isWeekday(); // true (if current date is 2019-07-19)
     

    maxDate

    Returns the maximum of the given dates.

    Use the ES6 spread syntax with Math.max to find the maximum date value, new Date() to convert it to a Date object.

    const maxDate = dates => new Date(Math.max(...dates));
     
    const array = [
       new Date(2017, 4, 13),
    diff --git a/docs/function.html b/docs/function.html
    index 02deeaaca..9812a60ea 100644
    --- a/docs/function.html
    +++ b/docs/function.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Function

    attempt

    Attempts to invoke a function with the provided arguments, returning either the result or the caught error object.

    Use a try... catch block to return either the result of the function or an appropriate error.

    const attempt = (fn, ...args) => {
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Function

    attempt

    Attempts to invoke a function with the provided arguments, returning either the result or the caught error object.

    Use a try... catch block to return either the result of the function or an appropriate error.

    const attempt = (fn, ...args) => {
       try {
         return fn(...args);
       } catch (e) {
    @@ -155,6 +155,7 @@ console.log<
     
     
     
    +
     const lengthIs4 = checkProp(l => l === 4, 'length');
     lengthIs4([]); // false
     lengthIs4([1,2,3,4]); // true
    diff --git a/docs/glossary.html b/docs/glossary.html
    index f149fa864..7ad5a039d 100644
    --- a/docs/glossary.html
    +++ b/docs/glossary.html
    @@ -76,4 +76,4 @@
                 }, 1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Glossary

    Developers use a lot of terminology daily. Every once in a while, you might find a term you do not know. We know how frustrating that can get, so we provide you with a handy glossary of frequently used web development terms.


    AJAX

    Asynchronous JavaScript and XML (known as AJAX) is a term that describes a new approach to using multiple technologies together in order to enable web applications to make quick updates to the user interface without reloading the entire browser page.

    API

    API stands for Application Programming Interface and is a set of features and rules provided by a provided by a software to enable third-party software to interact with it. The code features of a web API usually include methods, properties, events or URLs.

    Argument

    An argument is a value passed as an input to a function and can be either a primitive or an object. In JavaScript, functions can also be passed as arguments to other functions.

    Array

    Arrays are used to store multiple values in a single variable. Arrays are ordered and each item in an array has a numeric index associated with it. JavaScript arrays are zero-indexed, meaning the first element's index is 0.

    Asynchronous programming

    Asynchronous programming is a way to allow multiple events to trigger code without waiting for each other. The main benefits of asynchronous programming are improved application performance and responsiveness.

    Automatic semicolon insertion

    Automatic semicolon insertion (ASI) is a JavaScript feature that allows developers to omit semicolons in their code.

    Boolean

    Booleans are one of the primitive data types in JavaScript. They represent logical data values and can only be true or false.

    Callback

    A callback function, also known as a high-order function, is a function that is passed into another function as an argument, which is then executed inside the outer function. Callbacks can be synchronous or asynchronous.

    Character encoding

    A character encoding defines a mapping between bytes and text, specifying how the sequenece of bytes should be interpreted. Two commonly used character encodings are ASCII and UTF-8.

    Class

    In object-oriented programming, a class is a template definition of an object's properties and methods.

    Closure

    A closure is the combination of a function and the lexical environment within which that function was declared. The closure allows a function to access the contents of that environment.

    CoffeeScript

    CoffeeScript is a programming language inspired by Ruby, Python and Haskell that transpiles to JavaScript.

    Constant

    A constant is a value, associated with an identifier. The value of a constant can be accessed using the identifier and cannot be altered during execution.

    Constructor

    In class-based object-oriented programming, a constructor is a special type of function called to instantiate an object. Constructors often accept arguments that are commonly used to set member properties.

    Continuous Deployment

    Continuous Deployment follows the testing that happens during Continuous Integration and pushes changes to a staging or production system. Continuous Deployment ensures that a version of the codebase is accessible at all times.

    Continuous Integration

    Continuous Integration (CI) is the practice of testing each change done to a codebase automatically and as early as possible. Two popular CI systems that integrate with GitHub are Travis CI and Circle CI.

    CORS

    Cross-Origin Resource Sharing (known as CORS) is a mechanism that uses extra HTTP headers to tell a browser to let a web application running at one domain have permission to access resources from a server at a different domain.

    Cross-site scripting (XSS)

    XSS refers to client-side code injection where the attacker injects malicious scripts into a legitimate website or web application. This is often achieved when the application does not validate user input and freely injects dynamic HTML content.

    CSS

    CSS stands for Cascading Style Sheets and is a language used to style web pages. CSS documents are plaintext documents structured with rules, which consist of element selectors and property-value pairs that apply the styles to the specified selectors.

    CSV

    CSV stands for Comma-Separated Values and is a storage format for tabular data. CSV documents are plaintext documents where each line represents a table row, with table columns separated by commas or some other delimiter (e.g. semicolons). The first line of a CSV document sometimes consists of the table column headings for the data to follow.

    Currying

    Currying is a way of constructing functions that allows partial application of a function's arguments. Practically, this means that a function is broken down into a series of functions, each one accepting part of the arguments.

    Deserialization

    Deserialization is the process of converting a format that has been transferred over a network and/or used for storage to an object or data structure. A common type of deserialization in JavaScript is the conversion of JSON string into an object.

    DNS

    A DNS (Domain Name System) translates domain names to the IP addresses needed to find a particular computer service on a network.

    DOM

    The DOM (Document Object Model) is a cross-platform API that treats HTML and XML documents as a tree structure consisting of nodes. These nodes (such as elements and text nodes) are objects that can be programmatically manipulated and any visible changes made to them are reflected live in the document. In a browser, this API is available to JavaScript where DOM nodes can be manipulated to change their styles, contents, placement in the document, or interacted with through event listeners.

    Domain name registrar

    A domain name registrar is a company that manages the reservation of internet domain names. A domain name registrar must be approved by a general top-level domain (gTLD) registry or a country code top-level domain (ccTLD) registry.

    Domain name

    A domain name is a website's address on the Internet, used primarily in URLs to identify the server for each webpage. A domain name consists of a hierarchical sequence of names, separated by dots and ending with an extension.

    Element

    A JavaScript representation of a DOM element commonly returned by document.querySelector() and document.createElement(). They are used when creating content with JavaScript for display in the DOM that needs to be programatically generated.

    ES6

    ES6 stands for ECMAScript 6 (also known as ECMAScript 2015), a version of the ECMAScript specification that standardizes JavaScript. ES6 adds a wide variety of new features to the specification, such as classes, promises, generators and arrow functions.

    Event-driven programming

    Event-driven programming is a programming paradigm in which the flow of the program is determined by events (e.g. user actions, thread messages, sensor outputs). In event-driven applications, there is usually a main loop that listens for events and trigger callback functions accordingly when one of these events is detected.

    Event loop

    The event loop handles all asynchronous callbacks. Callbacks are queued in a loop, while other code runs, and will run one by one when the response for each one has been received. The event loop allows JavaScript to perform non-blocking I/O operations, despite the fact that JavaScript is single-threaded.

    Express

    Express is a backend framework, that provides a layer of fundamental web application features for Node.js. Some of its key features are routing, middleware, template engines and error handling.

    Factory functions

    In JavaScript, a factory function is any function, which is not a class or constructor, that returns a new object. Factory functions don't require the use of the new keyword.

    First-class function

    A programming language is said to have first-class functions if it treats them as first-class citizens, meaning they can be passed as arguments, be returned as values from other functions, be assigned to variables and stored in data structures.

    Flexbox

    Flexbox is a one-dimensional layout model used to style websites as a property that could advance space distribution between items and provide powerful alignment capabilities.

    Function

    Functions are self-contained blocks of code with their own scope, that can be called by other code and are usually associated with a unique identifier. Functions accept input in the form of arguments and can optionally return an output (if no return statement is present, the default value of undefined will be returned instead). JavaScript functions are also objects.

    Functional programming

    Functional programming is a paradigm in which programs are built in a declarative manner using pure functions that avoid shared state and mutable data. Functions that always return the same value for the same input and don't produce side effects are the pillar of functional programming.

    Functor

    A Functor is a data type common in functional programming that implements a map method. The map method takes a function and applies it to the data in the Functor, returning a new instance of the Functor with the result. JavaScript Arrays are an example of the Functor data type.

    Garbage collection

    Garbage collection is a form of automatic memory management. It attempts to reclaim memory occupied by objects that are no longer used by the program.

    Git

    Git is an open-source version control system, used for source code management. Git allows users to copy (clone) and edit code on their local machines, before merging it into the main code base (master repository).

    Higher-order function

    Higher-order functions are functions that either take other functions as arguments, return a function as a result, or both.

    Hoisting

    Hoisting is JavaScript's default behavior of adding declarations to memory during the compile phase. Hoisting allows for JavaScript variables to be used before the line they were declared on.

    HTML

    HTML stands for HyperText Markup Language and is a language used to structure web pages. HTML documents are plaintext documents structured with elements, which are surrounded by <> tags and optionally extended with attributes.

    HTTP and HTTPS

    The HyperText Transfer Protocol (HTTP) is the underlying network protocol that enables transfer of hypermedia documents on the Web, usually between a client and a server. The HyperText Transfer Protocol Secure (HTTPS) is an encrypted version of the HTTP protocol, that uses SSL to encrypt all data transferred between a client and a server.

    Integer

    Integers are one of the primitive data types in Javascript. They represent a numerical value that has no fractional component.

    Integration testing

    Integration testing is a type of software testing, used to test groups of units/components of a software. The purpose of integration tests are to validate that the units/components interact with each other as expected.

    IP

    An IP address is a number assigned to a device connected to a network that uses the Internet protocol. Two IP versions are currently in use - IPv4, the older version of the communication protocol (e.g. 192.168.1.100) and IPv6, the newest version of the communication protocol which allows for many different IP addresses (e.g. 0:0:0:0:ffff:c0a8:164).

    jQuery

    jQuery is a frontend JavaScript library, that simplifies DOM manipulation, AJAX calls and Event handling. jQuery uses its globally defined function, $(), to select and manipulate DOM elements.

    JSON

    JSON (JavaScript Object Notation) is a format for storing and exchanging data. It closely resembles the JavaScript object syntax, however some data types, such as dates and functions, cannot be natively represented and need to be serialized first.

    ajax api argument array asynchronous-programming automatic-semicolon-insertion boolean callback character-encoding class closure coffeescript constant constructor continuous-deployment continuous-integration cors cross-site-scripting-xss css csv currying deserialization dns dom domain-name-registrar domain-name element es6 event-driven-programming event-loop express factory-functions first-class-function flexbox function functional-programming functor garbage-collection git higher-order-function hoisting html http-and-https integer integration-testing ip jquery json keyword_database mdn module mongodb mutabe-value mvc node-js nosql npm object-oriented-programming object prepared-statements promise prototype-based-programming pseudo-class pseudo-element pwa react readme recursion regular-expressions repository responsive-web-design scope selector seo serialization shadowdom sql-injection sql ssl stream strict-mode string svg template-literals typescript unit-testing uri url utf-8 value-vs-reference variable viewport vue webassembly webcomponents webgl webrtc websockets xhtml xml yarn

    MDN

    MDN Web Docs, formerly known as Mozilla Developer Network, is the official Mozilla website for development documentation of web standards and Mozilla projects.

    Module

    Modules are independent, self-contained pieces of code that can be incorporated into other pieces of code. Modules improve maintainability and reusability of the code.

    MongoDB

    MongoDB is a NoSQL database model that stores data in flexible, JSON-like documents, meaning fields can vary from document to document and data structure can be changed over time

    Mutable value

    Mutable value is a type of variable that can be changed once created. Objects are mutable as their state can be modified after they are created. Primitive values are not mutable as we perform reassignment once we change them.

    MVC

    MVC stands for Model-View-Controller and is a software design pattern, emphasizing separation of concerns (logic and display). The Model part of the MVC pattern refers to the data and business logic, the View handles the layout and display, while the Controller routes commands to the model and view parts.

    Node.js

    Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js can execute JavaScript code outside of the browser and can be used to develop web backends or standalone applications.

    NoSQL

    NoSQL databases provide a mechanism to create, update, retrieve and calculate data that is stored in models that are non-tabular.

    Npm

    Npm is a package manager for the JavaScript programming language and the default package manager for Node.js. It consists of a command-line client and the npm registry, an online database of packages.

    Object-oriented programming

    Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which may contain both data and procedures which can be use to operate on them. JavaScript supports Object-oriented programming both via prototypes and classes.

    Object

    Objects are data structures that contain data and instructions for working with the data. Objects consist of key-value pairs, where the keys are alphanumeric identifiers and the values can either be primitives or objects. JavaScript functions are also objects.

    Prepared statements

    In databases management systems, prepared statements are templates that can be used to execute queries with the provided values substituting the template's parameters. Prepared statements offer many benefits, such as reusability, maintainability and higher security.

    Promise

    The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value. A Promise can be in one of these states: pending(initial state, neither fulfilled nor rejected), fulfilled(operation completed successfully), rejected(operation failed).

    Prototype-based programming

    Prototype-based programming is a style of object-oriented programming, where inheritance is based on object delegation, reusing objects that serve as prototypes. Prototype-based programming allows the creation of objects before defining their classes.

    Pseudo-class

    In CSS, a pseudo-class is used to define a special state of an element and can be used as a selector in combination with an id, element or class selector.

    Pseudo-element

    In CSS, a pseudo-element is used to style specific parts of an element and can be used as a selector in combination with an id, element or class selector.

    PWA

    Progressive Web App (known as PWA) is a term used to describe web applications that load like regular websites but can offer the user functionality such as working offline, push notifications, and device hardware access that were traditionally available only to native mobile applications.

    React

    React is a frontend framework, that allows developers to create dynamic, component-based user interfaces. React separates view and state, utilizing a virtual DOM to update the user interface.

    Recursion

    Recursion is the repeated application of a process. In JavaScript, recursion involves functions that call themselves repeatedly until they reach a base condition. The base condition breaks out of the recursion loop because otherwise the function would call itself indefinitely. Recursion is very useful when working with nested data, especially when the nesting depth is dynamically defined or unkown.

    Regular expressions

    Regular expressions (known as regex or regexp) are patterns used to match character combinations in strings. JavaScript provides a regular expression implementation through the RegExp object.

    Repository

    In a version control system, a repository (or repo for short) is a data structure that stores metadata for a set of files (i.e. a project).

    Responsive web design

    Responsive web design is a web development concept aiming to provide optimal behavior and performance of websites on all web-enabled devices. Responsive web design is usually coupled with a mobile-first approach.

    Scope

    Each function has its own scope, and any variable declared within that function is only accessible from that function and any nested functions.

    Selector

    A CSS selector is a pattern that is used to select and/or style one or more elements in a document, based on certain rules. The order in which CSS selectors apply styles to elements is based on the rules of CSS specificity.

    SEO

    SEO stands for Search Engine Optimization and refers to the process of improving a website's search rankings and visibility.

    Serialization

    Serialization is the process of converting an object or data structure into a format suitable for transfer over a network and/or storage. A common type of serialization in JavaScript is the conversion of an object into a JSON string.

    Shadow DOM

    Shadow DOM allows you to attach hidden DOM trees to elements in the normal DOM tree, which are included in the document rendering, but excluded from the main document DOM tree. A shadow DOM tree will start with a shadow root, to which you can attach any elements you want, just like in a regular DOM. Examples of shadow DOM uses are the <video>/<audio> elements and the simple <input type="range"> element.

    SQL injection

    SQL injection is a code injection technique, used to attack data-driven applications. SQL injections get their name from the SQL language and mainly target data stored in relational databases.

    SQL

    SQL stands for Structured Query Language and is a language used to create, update, retrieve and calculate data in table-based databases. SQL databases use a relational database model and are particularly useful in handlind structured data with relations between different entities.

    SSL

    Secure Sockets Layer, commonly known as SSL or TLS, is a set of protocols and standards for transferring private data across the Internet. SSL uses a cryptographic system that uses two keys to encrypt data.

    Stream

    A stream is a sequence of data made available over time, often due to network transmission or storage access times.

    Strict mode

    JavaScript's strict mode is a JavaScript feature that allows developers to use a more restrictive variant of JavaScript and it can be enabled by adding 'use strict'; at the very top of their code. Strict mode elimiated some silent errors, might improve performance and changes the behavior of eval and arguments among other things.

    String

    Strings are one of the primitive data types in JavaScript. They are sequences of characters and are used to represent text.

    SVG

    SVG stands for Scalable Vector Graphics and is a 2D vector image format based on an XML syntax. SVG images can scale infinitely and can utilize clipping, masking, filters, animations etc.

    Template literals

    Template literals are strings that allow embedded expressions. They support multi-line strings, expression interpolation and nesting.

    TypeScript

    TypeScript is a superset of JavaScript, adding optional static typing to the language. TypeScript compiles to plain JavaScript.

    Unit testing

    Unit testing is a type of software testing, used to test individual units/components of a software. The purpose of unit tests are to validate that each individual unit/component performs as designed.

    URI

    URI stands for Uniform Resource Identifier and is a text string referring to a resource. A common type of URI is a URL, which is used for the identification of resources on the Web.

    URL

    URL stands for Uniform Resource Locator and is a text string specifying where a resource can be found on the Internet. In the HTTP protocol, URLs are the same as web addresses and hyperlinks.

    UTF-8

    UTF-8 stands for UCS Transformation Format 8 and is a commonly used character encoding. UTF-8 is backwards compatible with ASCII and can represent any standard Unicode character.

    Value vs reference

    When passing a variable by value, a copy of the variable is made, meaning that any changes made to the contents of the variable will not be reflected in the original variable. When passing a variable by reference, the memory address of the actual variable is passed to the function or variable, meaning that modifying the variable's contents will be reflected in the original variable. In JavaScript primitive data types are passed by value while objects are passed by reference.

    Variable

    A variable is a storage location, associated with an identifier and containing a value. The value of a variable can be referred using the identifier and can be altered during execution.

    Viewport

    A viewport is a polygonal (usually rectangular) area in computer graphics that is currently being viewed. In web development and design, it refers to the visible part of the document that is being viewed by the user in the browser window.

    Vue

    Vue.js is a progressive frontend framework for building user interfaces. Vue.js separates view and state, utilizing a virtual DOM to update the user interface.

    WebAssembly

    WebAssembly (WA) is a web standard that defines an assembly-like text format and corresponding binary format for executalbe code in web pages. WebAssembly is meant to complement JavaScript and improve its performance to match native code performance.

    Web Components

    Web Components are a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use on web pages and apps. Building custom components using these standards means that you can use them across modern browsers regardless of any JavaScript library or framework.

    WebGL

    WebGL stands for Web Graphics Library and is a JavaScript API that can be used for drawing interactive 2D and 3D graphics. WebGL is based on OpenGL and can be invoked within HTML <canvas> elements, which provide a rendering surface.

    WebRTC

    WebRTC stands for Web Real-Time Communication and is an API that can be used for video-chat, voice-calling and P2P-file-sharing web apps.

    WebSockets

    WebSockets is a protocol that allows for a persistent client-server TCP connection. The WebSocket protocol uses lower overheads, facilitating real-time data transfer between client and server.

    XHTML

    XHTML stands for EXtensible HyperText Markup Language and is a language used to structure web pages. XHTML is a reformulation of the HTML document structure as an application of XML.

    XML

    XML stands for eXtensible Markup Language and is a generic markup language specified by the W3C. XML documents are plaintext documents structured with user-defined tags, surrounded by <> and optionally extended with attributes.

    Yarn

    Yarn is a package manager made by Facebook. It can be used as an alternative to the npm package manager and is compatible with the public NPM registry.

    \ No newline at end of file + }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Glossary

    Developers use a lot of terminology daily. Every once in a while, you might find a term you do not know. We know how frustrating that can get, so we provide you with a handy glossary of frequently used web development terms.


    AJAX

    Asynchronous JavaScript and XML (known as AJAX) is a term that describes a new approach to using multiple technologies together in order to enable web applications to make quick updates to the user interface without reloading the entire browser page.

    API

    API stands for Application Programming Interface and is a set of features and rules provided by a provided by a software to enable third-party software to interact with it. The code features of a web API usually include methods, properties, events or URLs.

    Argument

    An argument is a value passed as an input to a function and can be either a primitive or an object. In JavaScript, functions can also be passed as arguments to other functions.

    Array

    Arrays are used to store multiple values in a single variable. Arrays are ordered and each item in an array has a numeric index associated with it. JavaScript arrays are zero-indexed, meaning the first element's index is 0.

    Asynchronous programming

    Asynchronous programming is a way to allow multiple events to trigger code without waiting for each other. The main benefits of asynchronous programming are improved application performance and responsiveness.

    Automatic semicolon insertion

    Automatic semicolon insertion (ASI) is a JavaScript feature that allows developers to omit semicolons in their code.

    Boolean

    Booleans are one of the primitive data types in JavaScript. They represent logical data values and can only be true or false.

    Callback

    A callback function, also known as a high-order function, is a function that is passed into another function as an argument, which is then executed inside the outer function. Callbacks can be synchronous or asynchronous.

    Character encoding

    A character encoding defines a mapping between bytes and text, specifying how the sequenece of bytes should be interpreted. Two commonly used character encodings are ASCII and UTF-8.

    Class

    In object-oriented programming, a class is a template definition of an object's properties and methods.

    Closure

    A closure is the combination of a function and the lexical environment within which that function was declared. The closure allows a function to access the contents of that environment.

    CoffeeScript

    CoffeeScript is a programming language inspired by Ruby, Python and Haskell that transpiles to JavaScript.

    Constant

    A constant is a value, associated with an identifier. The value of a constant can be accessed using the identifier and cannot be altered during execution.

    Constructor

    In class-based object-oriented programming, a constructor is a special type of function called to instantiate an object. Constructors often accept arguments that are commonly used to set member properties.

    Continuous Deployment

    Continuous Deployment follows the testing that happens during Continuous Integration and pushes changes to a staging or production system. Continuous Deployment ensures that a version of the codebase is accessible at all times.

    Continuous Integration

    Continuous Integration (CI) is the practice of testing each change done to a codebase automatically and as early as possible. Two popular CI systems that integrate with GitHub are Travis CI and Circle CI.

    CORS

    Cross-Origin Resource Sharing (known as CORS) is a mechanism that uses extra HTTP headers to tell a browser to let a web application running at one domain have permission to access resources from a server at a different domain.

    Cross-site scripting (XSS)

    XSS refers to client-side code injection where the attacker injects malicious scripts into a legitimate website or web application. This is often achieved when the application does not validate user input and freely injects dynamic HTML content.

    CSS

    CSS stands for Cascading Style Sheets and is a language used to style web pages. CSS documents are plaintext documents structured with rules, which consist of element selectors and property-value pairs that apply the styles to the specified selectors.

    CSV

    CSV stands for Comma-Separated Values and is a storage format for tabular data. CSV documents are plaintext documents where each line represents a table row, with table columns separated by commas or some other delimiter (e.g. semicolons). The first line of a CSV document sometimes consists of the table column headings for the data to follow.

    Currying

    Currying is a way of constructing functions that allows partial application of a function's arguments. Practically, this means that a function is broken down into a series of functions, each one accepting part of the arguments.

    Deserialization

    Deserialization is the process of converting a format that has been transferred over a network and/or used for storage to an object or data structure. A common type of deserialization in JavaScript is the conversion of JSON string into an object.

    DNS

    A DNS (Domain Name System) translates domain names to the IP addresses needed to find a particular computer service on a network.

    DOM

    The DOM (Document Object Model) is a cross-platform API that treats HTML and XML documents as a tree structure consisting of nodes. These nodes (such as elements and text nodes) are objects that can be programmatically manipulated and any visible changes made to them are reflected live in the document. In a browser, this API is available to JavaScript where DOM nodes can be manipulated to change their styles, contents, placement in the document, or interacted with through event listeners.

    Domain name registrar

    A domain name registrar is a company that manages the reservation of internet domain names. A domain name registrar must be approved by a general top-level domain (gTLD) registry or a country code top-level domain (ccTLD) registry.

    Domain name

    A domain name is a website's address on the Internet, used primarily in URLs to identify the server for each webpage. A domain name consists of a hierarchical sequence of names, separated by dots and ending with an extension.

    Element

    A JavaScript representation of a DOM element commonly returned by document.querySelector() and document.createElement(). They are used when creating content with JavaScript for display in the DOM that needs to be programatically generated.

    ES6

    ES6 stands for ECMAScript 6 (also known as ECMAScript 2015), a version of the ECMAScript specification that standardizes JavaScript. ES6 adds a wide variety of new features to the specification, such as classes, promises, generators and arrow functions.

    Event-driven programming

    Event-driven programming is a programming paradigm in which the flow of the program is determined by events (e.g. user actions, thread messages, sensor outputs). In event-driven applications, there is usually a main loop that listens for events and trigger callback functions accordingly when one of these events is detected.

    Event loop

    The event loop handles all asynchronous callbacks. Callbacks are queued in a loop, while other code runs, and will run one by one when the response for each one has been received. The event loop allows JavaScript to perform non-blocking I/O operations, despite the fact that JavaScript is single-threaded.

    Express

    Express is a backend framework, that provides a layer of fundamental web application features for Node.js. Some of its key features are routing, middleware, template engines and error handling.

    Factory functions

    In JavaScript, a factory function is any function, which is not a class or constructor, that returns a new object. Factory functions don't require the use of the new keyword.

    First-class function

    A programming language is said to have first-class functions if it treats them as first-class citizens, meaning they can be passed as arguments, be returned as values from other functions, be assigned to variables and stored in data structures.

    Flexbox

    Flexbox is a one-dimensional layout model used to style websites as a property that could advance space distribution between items and provide powerful alignment capabilities.

    Function

    Functions are self-contained blocks of code with their own scope, that can be called by other code and are usually associated with a unique identifier. Functions accept input in the form of arguments and can optionally return an output (if no return statement is present, the default value of undefined will be returned instead). JavaScript functions are also objects.

    Functional programming

    Functional programming is a paradigm in which programs are built in a declarative manner using pure functions that avoid shared state and mutable data. Functions that always return the same value for the same input and don't produce side effects are the pillar of functional programming.

    Functor

    A Functor is a data type common in functional programming that implements a map method. The map method takes a function and applies it to the data in the Functor, returning a new instance of the Functor with the result. JavaScript Arrays are an example of the Functor data type.

    Garbage collection

    Garbage collection is a form of automatic memory management. It attempts to reclaim memory occupied by objects that are no longer used by the program.

    Git

    Git is an open-source version control system, used for source code management. Git allows users to copy (clone) and edit code on their local machines, before merging it into the main code base (master repository).

    Higher-order function

    Higher-order functions are functions that either take other functions as arguments, return a function as a result, or both.

    Hoisting

    Hoisting is JavaScript's default behavior of adding declarations to memory during the compile phase. Hoisting allows for JavaScript variables to be used before the line they were declared on.

    HTML

    HTML stands for HyperText Markup Language and is a language used to structure web pages. HTML documents are plaintext documents structured with elements, which are surrounded by <> tags and optionally extended with attributes.

    HTTP and HTTPS

    The HyperText Transfer Protocol (HTTP) is the underlying network protocol that enables transfer of hypermedia documents on the Web, usually between a client and a server. The HyperText Transfer Protocol Secure (HTTPS) is an encrypted version of the HTTP protocol, that uses SSL to encrypt all data transferred between a client and a server.

    Integer

    Integers are one of the primitive data types in Javascript. They represent a numerical value that has no fractional component.

    Integration testing

    Integration testing is a type of software testing, used to test groups of units/components of a software. The purpose of integration tests are to validate that the units/components interact with each other as expected.

    IP

    An IP address is a number assigned to a device connected to a network that uses the Internet protocol. Two IP versions are currently in use - IPv4, the older version of the communication protocol (e.g. 192.168.1.100) and IPv6, the newest version of the communication protocol which allows for many different IP addresses (e.g. 0:0:0:0:ffff:c0a8:164).

    jQuery

    jQuery is a frontend JavaScript library, that simplifies DOM manipulation, AJAX calls and Event handling. jQuery uses its globally defined function, $(), to select and manipulate DOM elements.

    JSON

    JSON (JavaScript Object Notation) is a format for storing and exchanging data. It closely resembles the JavaScript object syntax, however some data types, such as dates and functions, cannot be natively represented and need to be serialized first.

    ajax api argument array asynchronous-programming automatic-semicolon-insertion boolean callback character-encoding class closure coffeescript constant constructor continuous-deployment continuous-integration cors cross-site-scripting-xss css csv currying deserialization dns dom domain-name-registrar domain-name element es6 event-driven-programming event-loop express factory-functions first-class-function flexbox function functional-programming functor garbage-collection git higher-order-function hoisting html http-and-https integer integration-testing ip jquery json keyword_database mdn module mongodb mutabe-value mvc node-js nosql npm object-oriented-programming object prepared-statements promise prototype-based-programming pseudo-class pseudo-element pwa react readme recursion regular-expressions repository responsive-web-design scope selector seo serialization shadowdom sql-injection sql ssl stream strict-mode string svg template-literals typescript unit-testing uri url utf-8 value-vs-reference variable viewport vue webassembly webcomponents webgl webrtc websockets xhtml xml yarn

    MDN

    MDN Web Docs, formerly known as Mozilla Developer Network, is the official Mozilla website for development documentation of web standards and Mozilla projects.

    Module

    Modules are independent, self-contained pieces of code that can be incorporated into other pieces of code. Modules improve maintainability and reusability of the code.

    MongoDB

    MongoDB is a NoSQL database model that stores data in flexible, JSON-like documents, meaning fields can vary from document to document and data structure can be changed over time

    Mutable value

    Mutable value is a type of variable that can be changed once created. Objects are mutable as their state can be modified after they are created. Primitive values are not mutable as we perform reassignment once we change them.

    MVC

    MVC stands for Model-View-Controller and is a software design pattern, emphasizing separation of concerns (logic and display). The Model part of the MVC pattern refers to the data and business logic, the View handles the layout and display, while the Controller routes commands to the model and view parts.

    Node.js

    Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js can execute JavaScript code outside of the browser and can be used to develop web backends or standalone applications.

    NoSQL

    NoSQL databases provide a mechanism to create, update, retrieve and calculate data that is stored in models that are non-tabular.

    Npm

    Npm is a package manager for the JavaScript programming language and the default package manager for Node.js. It consists of a command-line client and the npm registry, an online database of packages.

    Object-oriented programming

    Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which may contain both data and procedures which can be use to operate on them. JavaScript supports Object-oriented programming both via prototypes and classes.

    Object

    Objects are data structures that contain data and instructions for working with the data. Objects consist of key-value pairs, where the keys are alphanumeric identifiers and the values can either be primitives or objects. JavaScript functions are also objects.

    Prepared statements

    In databases management systems, prepared statements are templates that can be used to execute queries with the provided values substituting the template's parameters. Prepared statements offer many benefits, such as reusability, maintainability and higher security.

    Promise

    The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value. A Promise can be in one of these states: pending(initial state, neither fulfilled nor rejected), fulfilled(operation completed successfully), rejected(operation failed).

    Prototype-based programming

    Prototype-based programming is a style of object-oriented programming, where inheritance is based on object delegation, reusing objects that serve as prototypes. Prototype-based programming allows the creation of objects before defining their classes.

    Pseudo-class

    In CSS, a pseudo-class is used to define a special state of an element and can be used as a selector in combination with an id, element or class selector.

    Pseudo-element

    In CSS, a pseudo-element is used to style specific parts of an element and can be used as a selector in combination with an id, element or class selector.

    PWA

    Progressive Web App (known as PWA) is a term used to describe web applications that load like regular websites but can offer the user functionality such as working offline, push notifications, and device hardware access that were traditionally available only to native mobile applications.

    React

    React is a frontend framework, that allows developers to create dynamic, component-based user interfaces. React separates view and state, utilizing a virtual DOM to update the user interface.

    Recursion

    Recursion is the repeated application of a process. In JavaScript, recursion involves functions that call themselves repeatedly until they reach a base condition. The base condition breaks out of the recursion loop because otherwise the function would call itself indefinitely. Recursion is very useful when working with nested data, especially when the nesting depth is dynamically defined or unkown.

    Regular expressions

    Regular expressions (known as regex or regexp) are patterns used to match character combinations in strings. JavaScript provides a regular expression implementation through the RegExp object.

    Repository

    In a version control system, a repository (or repo for short) is a data structure that stores metadata for a set of files (i.e. a project).

    Responsive web design

    Responsive web design is a web development concept aiming to provide optimal behavior and performance of websites on all web-enabled devices. Responsive web design is usually coupled with a mobile-first approach.

    Scope

    Each function has its own scope, and any variable declared within that function is only accessible from that function and any nested functions.

    Selector

    A CSS selector is a pattern that is used to select and/or style one or more elements in a document, based on certain rules. The order in which CSS selectors apply styles to elements is based on the rules of CSS specificity.

    SEO

    SEO stands for Search Engine Optimization and refers to the process of improving a website's search rankings and visibility.

    Serialization

    Serialization is the process of converting an object or data structure into a format suitable for transfer over a network and/or storage. A common type of serialization in JavaScript is the conversion of an object into a JSON string.

    Shadow DOM

    Shadow DOM allows you to attach hidden DOM trees to elements in the normal DOM tree, which are included in the document rendering, but excluded from the main document DOM tree. A shadow DOM tree will start with a shadow root, to which you can attach any elements you want, just like in a regular DOM. Examples of shadow DOM uses are the <video>/<audio> elements and the simple <input type="range"> element.

    SQL injection

    SQL injection is a code injection technique, used to attack data-driven applications. SQL injections get their name from the SQL language and mainly target data stored in relational databases.

    SQL

    SQL stands for Structured Query Language and is a language used to create, update, retrieve and calculate data in table-based databases. SQL databases use a relational database model and are particularly useful in handlind structured data with relations between different entities.

    SSL

    Secure Sockets Layer, commonly known as SSL or TLS, is a set of protocols and standards for transferring private data across the Internet. SSL uses a cryptographic system that uses two keys to encrypt data.

    Stream

    A stream is a sequence of data made available over time, often due to network transmission or storage access times.

    Strict mode

    JavaScript's strict mode is a JavaScript feature that allows developers to use a more restrictive variant of JavaScript and it can be enabled by adding 'use strict'; at the very top of their code. Strict mode elimiated some silent errors, might improve performance and changes the behavior of eval and arguments among other things.

    String

    Strings are one of the primitive data types in JavaScript. They are sequences of characters and are used to represent text.

    SVG

    SVG stands for Scalable Vector Graphics and is a 2D vector image format based on an XML syntax. SVG images can scale infinitely and can utilize clipping, masking, filters, animations etc.

    Template literals

    Template literals are strings that allow embedded expressions. They support multi-line strings, expression interpolation and nesting.

    TypeScript

    TypeScript is a superset of JavaScript, adding optional static typing to the language. TypeScript compiles to plain JavaScript.

    Unit testing

    Unit testing is a type of software testing, used to test individual units/components of a software. The purpose of unit tests are to validate that each individual unit/component performs as designed.

    URI

    URI stands for Uniform Resource Identifier and is a text string referring to a resource. A common type of URI is a URL, which is used for the identification of resources on the Web.

    URL

    URL stands for Uniform Resource Locator and is a text string specifying where a resource can be found on the Internet. In the HTTP protocol, URLs are the same as web addresses and hyperlinks.

    UTF-8

    UTF-8 stands for UCS Transformation Format 8 and is a commonly used character encoding. UTF-8 is backwards compatible with ASCII and can represent any standard Unicode character.

    Value vs reference

    When passing a variable by value, a copy of the variable is made, meaning that any changes made to the contents of the variable will not be reflected in the original variable. When passing a variable by reference, the memory address of the actual variable is passed to the function or variable, meaning that modifying the variable's contents will be reflected in the original variable. In JavaScript primitive data types are passed by value while objects are passed by reference.

    Variable

    A variable is a storage location, associated with an identifier and containing a value. The value of a variable can be referred using the identifier and can be altered during execution.

    Viewport

    A viewport is a polygonal (usually rectangular) area in computer graphics that is currently being viewed. In web development and design, it refers to the visible part of the document that is being viewed by the user in the browser window.

    Vue

    Vue.js is a progressive frontend framework for building user interfaces. Vue.js separates view and state, utilizing a virtual DOM to update the user interface.

    WebAssembly

    WebAssembly (WA) is a web standard that defines an assembly-like text format and corresponding binary format for executalbe code in web pages. WebAssembly is meant to complement JavaScript and improve its performance to match native code performance.

    Web Components

    Web Components are a set of web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use on web pages and apps. Building custom components using these standards means that you can use them across modern browsers regardless of any JavaScript library or framework.

    WebGL

    WebGL stands for Web Graphics Library and is a JavaScript API that can be used for drawing interactive 2D and 3D graphics. WebGL is based on OpenGL and can be invoked within HTML <canvas> elements, which provide a rendering surface.

    WebRTC

    WebRTC stands for Web Real-Time Communication and is an API that can be used for video-chat, voice-calling and P2P-file-sharing web apps.

    WebSockets

    WebSockets is a protocol that allows for a persistent client-server TCP connection. The WebSocket protocol uses lower overheads, facilitating real-time data transfer between client and server.

    XHTML

    XHTML stands for EXtensible HyperText Markup Language and is a language used to structure web pages. XHTML is a reformulation of the HTML document structure as an application of XML.

    XML

    XML stands for eXtensible Markup Language and is a generic markup language specified by the W3C. XML documents are plaintext documents structured with user-defined tags, surrounded by <> and optionally extended with attributes.

    Yarn

    Yarn is a package manager made by Facebook. It can be used as an alternative to the npm package manager and is compatible with the public NPM registry.

    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 82aa995f8..89f35a8f6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -93,7 +93,7 @@ },1700); } }, false); - }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Array

    all

    Returns true if the provided predicate function returns true for all elements in a collection, false otherwise.

    Use Array.prototype.every() to test if all elements in the collection return true based on fn. Omit the second argument, fn, to use Boolean as a default.

    const all = (arr, fn = Boolean) => arr.every(fn);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Array

    all

    Returns true if the provided predicate function returns true for all elements in a collection, false otherwise.

    Use Array.prototype.every() to test if all elements in the collection return true based on fn. Omit the second argument, fn, to use Boolean as a default.

    const all = (arr, fn = Boolean) => arr.every(fn);
     
    all([4, 2, 3], x => x > 1); // true
     all([1, 2, 3]); // true
     

    allEqual

    Check if all elements in an array are equal.

    Use Array.prototype.every() to check if all the elements of the array are the same as the first one. Elements in the array are compared using the strict comparison operator, which does not account for NaN self-inequality.

    const allEqual = arr => arr.every(val => val === arr[0]);
    @@ -414,9 +414,9 @@
     

    remove

    Removes elements from an array for which the given function returns false.

    Use Array.prototype.filter() to find array elements that return truthy values and Array.prototype.reduce() to remove elements using Array.prototype.splice(). The func is invoked with three arguments (value, index, array).

    const remove = (arr, func) =>
       Array.isArray(arr)
         ? arr.filter(func).reduce((acc, val) => {
    -      arr.splice(arr.indexOf(val), 1);
    -      return acc.concat(val);
    -    }, [])
    +        arr.splice(arr.indexOf(val), 1);
    +        return acc.concat(val);
    +      }, [])
         : [];
     
    remove([1, 2, 3, 4], n => n % 2 === 0); // [2, 4]
     

    sample

    Returns a random element from an array.

    Use Math.random() to generate a random number, multiply it by length and round it off to the nearest whole number using Math.floor(). This method also works with strings.

    const sample = arr => arr[Math.floor(Math.random() * arr.length)];
    diff --git a/docs/math.html b/docs/math.html
    index d3ab4362d..ff820c0bd 100644
    --- a/docs/math.html
    +++ b/docs/math.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Math

    approximatelyEqual

    Checks if two numbers are approximately equal to each other.

    Use Math.abs() to compare the absolute difference of the two values to epsilon. Omit the third parameter, epsilon, to use a default value of 0.001.

    const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Math

    approximatelyEqual

    Checks if two numbers are approximately equal to each other.

    Use Math.abs() to compare the absolute difference of the two values to epsilon. Omit the third parameter, epsilon, to use a default value of 0.001.

    const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
     
    approximatelyEqual(Math.PI / 2.0, 1.5708); // true
     

    average

    Returns the average of two or more numbers.

    Use Array.prototype.reduce() to add each value to an accumulator, initialized with a value of 0, divide by the length of the array.

    const average = (...nums) => nums.reduce((acc, val) => acc + val, 0) / nums.length;
     
    average(...[1, 2, 3]); // 2
    @@ -152,8 +152,8 @@ own individual rating by supplying it as the third argument.
     

    factorial

    Calculates the factorial of a number.

    Use recursion. If n is less than or equal to 1, return 1. Otherwise, return the product of n and the factorial of n - 1. Throws an exception if n is a negative number.

    const factorial = n =>
       n < 0
         ? (() => {
    -      throw new TypeError('Negative numbers are not allowed!');
    -    })()
    +        throw new TypeError('Negative numbers are not allowed!');
    +      })()
         : n <= 1
           ? 1
           : n * factorial(n - 1);
    diff --git a/docs/node.html b/docs/node.html
    index e84d0f3c3..20dcafe95 100644
    --- a/docs/node.html
    +++ b/docs/node.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Node

    atob

    Decodes a string of data which has been encoded using base-64 encoding.

    Create a Buffer for the given string with base-64 encoding and use Buffer.toString('binary') to return the decoded string.

    const atob = str => Buffer.from(str, 'base64').toString('binary');
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Node

    atob

    Decodes a string of data which has been encoded using base-64 encoding.

    Create a Buffer for the given string with base-64 encoding and use Buffer.toString('binary') to return the decoded string.

    const atob = str => Buffer.from(str, 'base64').toString('binary');
     
    atob('Zm9vYmFy'); // 'foobar'
     

    btoa

    Creates a base-64 encoded ASCII string from a String object in which each character in the string is treated as a byte of binary data.

    Create a Buffer for the given string with binary encoding and use Buffer.toString('base64') to return the encoded string.

    const btoa = str => Buffer.from(str, 'binary').toString('base64');
     
    btoa('foobar'); // 'Zm9vYmFy'
    diff --git a/docs/object.html b/docs/object.html
    index 0acc5dbd9..ae64ccb51 100644
    --- a/docs/object.html
    +++ b/docs/object.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Object

    bindAll

    Binds methods of an object to the object itself, overwriting the existing method.

    Use Array.prototype.forEach() to return a function that uses Function.prototype.apply() to apply the given context (obj) to fn for each function specified.

    const bindAll = (obj, ...fns) =>
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Object

    bindAll

    Binds methods of an object to the object itself, overwriting the existing method.

    Use Array.prototype.forEach() to return a function that uses Function.prototype.apply() to apply the given context (obj) to fn for each function specified.

    const bindAll = (obj, ...fns) =>
       fns.forEach(
         fn => (
           (f = obj[fn]),
    @@ -151,11 +151,11 @@ o[1? obj.map(val => deepMapKeys(val, f))
         : typeof obj === 'object'
           ? Object.keys(obj).reduce((acc, current) => {
    -        const val = obj[current];
    -        acc[f(current)] =
    +          const val = obj[current];
    +          acc[f(current)] =
                 val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
    -        return acc;
    -      }, {})
    +          return acc;
    +        }, {})
           : obj;
     
    const obj = {
       foo: '1',
    @@ -190,9 +190,9 @@ o[1in obj
         ? obj[target]
         : Object.values(obj).reduce((acc, val) => {
    -      if (acc !== undefined) return acc;
    -      if (typeof val === 'object') return dig(val, target);
    -    }, undefined);
    +        if (acc !== undefined) return acc;
    +        if (typeof val === 'object') return dig(val, target);
    +      }, undefined);
     
    const data = {
       level1: {
         level2: {
    diff --git a/docs/string.html b/docs/string.html
    index af95a7cad..b0dcd49ca 100644
    --- a/docs/string.html
    +++ b/docs/string.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    String

    byteSize

    Returns the length of a string in bytes.

    Convert a given string to a Blob Object and find its size.

    const byteSize = str => new Blob([str]).size;
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    String

    byteSize

    Returns the length of a string in bytes.

    Convert a given string to a Blob Object and find its size.

    const byteSize = str => new Blob([str]).size;
     
    byteSize('😀'); // 4
     byteSize('Hello World'); // 11
     

    capitalize

    Capitalizes the first letter of a string.

    Use array destructuring and String.prototype.toUpperCase() to capitalize first letter, ...rest to get array of characters after first letter and then Array.prototype.join('') to make it a string again. Omit the lowerRest parameter to keep the rest of the string intact, or set it to true to convert to lowercase.

    const capitalize = ([first, ...rest], lowerRest = false) =>
    diff --git a/docs/type.html b/docs/type.html
    index 14f8987d0..6bb9ada77 100644
    --- a/docs/type.html
    +++ b/docs/type.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Type

    getType

    Returns the native type of a value.

    Returns lowercased constructor name of value, "undefined" or "null" if value is undefined or null.

    const getType = v =>
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Type

    getType

    Returns the native type of a value.

    Returns lowercased constructor name of value, "undefined" or "null" if value is undefined or null.

    const getType = v =>
       v === undefined ? 'undefined' : v === null ? 'null' : v.constructor.name.toLowerCase();
     
    getType(new Set([1, 2, 3])); // 'set'
     

    is

    Checks if the provided value is of the specified type.

    Ensure the value is not undefined or null using Array.prototype.includes(), and compare the constructor property on the value with type to check if the provided value is of the specified type.

    const is = (type, val) => ![, null].includes(val) && val.constructor === type;
    diff --git a/docs/utility.html b/docs/utility.html
    index af4a468d1..07cda5eca 100644
    --- a/docs/utility.html
    +++ b/docs/utility.html
    @@ -93,7 +93,7 @@
                 },1700);
               }
             }, false);
    -      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Utility

    castArray

    Casts the provided value as an array if it's not one.

    Use Array.prototype.isArray() to determine if val is an array and return it as-is or encapsulated in an array accordingly.

    const castArray = val => (Array.isArray(val) ? val : [val]);
    +      }

    logo 30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.



    Utility

    castArray

    Casts the provided value as an array if it's not one.

    Use Array.prototype.isArray() to determine if val is an array and return it as-is or encapsulated in an array accordingly.

    const castArray = val => (Array.isArray(val) ? val : [val]);
     
    castArray('foo'); // ['foo']
     castArray([1]); // [1]
     

    cloneRegExp

    Clones a regular expression.

    Use new RegExp(), RegExp.source and RegExp.flags to clone the given regular expression.

    const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags);
    diff --git a/snippets/checkProp.md b/snippets/checkProp.md
    index 391d872d6..3262f3969 100644
    --- a/snippets/checkProp.md
    +++ b/snippets/checkProp.md
    @@ -20,6 +20,7 @@ const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);
     
     
     
    +
     const lengthIs4 = checkProp(l => l === 4, 'length');
     lengthIs4([]); // false
     lengthIs4([1,2,3,4]); // true
    diff --git a/snippets/deepMapKeys.md b/snippets/deepMapKeys.md
    index c736420ee..970453bdc 100644
    --- a/snippets/deepMapKeys.md
    +++ b/snippets/deepMapKeys.md
    @@ -13,11 +13,11 @@ const deepMapKeys = (obj, f) =>
         ? obj.map(val => deepMapKeys(val, f))
         : typeof obj === 'object'
           ? Object.keys(obj).reduce((acc, current) => {
    -        const val = obj[current];
    -        acc[f(current)] =
    +          const val = obj[current];
    +          acc[f(current)] =
                 val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
    -        return acc;
    -      }, {})
    +          return acc;
    +        }, {})
           : obj;
     ```
     
    diff --git a/snippets/dig.md b/snippets/dig.md
    index 737130b6e..c97559833 100644
    --- a/snippets/dig.md
    +++ b/snippets/dig.md
    @@ -10,9 +10,9 @@ const dig = (obj, target) =>
       target in obj
         ? obj[target]
         : Object.values(obj).reduce((acc, val) => {
    -      if (acc !== undefined) return acc;
    -      if (typeof val === 'object') return dig(val, target);
    -    }, undefined);
    +        if (acc !== undefined) return acc;
    +        if (typeof val === 'object') return dig(val, target);
    +      }, undefined);
     ```
     
     ```js
    diff --git a/snippets/factorial.md b/snippets/factorial.md
    index cf3acc9cc..86ebe69b6 100644
    --- a/snippets/factorial.md
    +++ b/snippets/factorial.md
    @@ -11,8 +11,8 @@ Throws an exception if `n` is a negative number.
     const factorial = n =>
       n < 0
         ? (() => {
    -      throw new TypeError('Negative numbers are not allowed!');
    -    })()
    +        throw new TypeError('Negative numbers are not allowed!');
    +      })()
         : n <= 1
           ? 1
           : n * factorial(n - 1);
    diff --git a/snippets/pipeAsyncFunctions.md b/snippets/pipeAsyncFunctions.md
    index 47d6f620c..8c93add3b 100644
    --- a/snippets/pipeAsyncFunctions.md
    +++ b/snippets/pipeAsyncFunctions.md
    @@ -17,7 +17,7 @@ const sum = pipeAsyncFunctions(
       x => x + 3,
       async x => (await x) + 4
     );
    -(async() => {
    +(async () => {
       console.log(await sum(5)); // 15 (after one second)
     })();
     ```
    diff --git a/snippets/remove.md b/snippets/remove.md
    index 58de9c2e0..a8c472774 100644
    --- a/snippets/remove.md
    +++ b/snippets/remove.md
    @@ -9,9 +9,9 @@ The `func` is invoked with three arguments (`value, index, array`).
     const remove = (arr, func) =>
       Array.isArray(arr)
         ? arr.filter(func).reduce((acc, val) => {
    -      arr.splice(arr.indexOf(val), 1);
    -      return acc.concat(val);
    -    }, [])
    +        arr.splice(arr.indexOf(val), 1);
    +        return acc.concat(val);
    +      }, [])
         : [];
     ```
     
    diff --git a/test/_30s.js b/test/_30s.js
    index f93b68b26..689ce6076 100644
    --- a/test/_30s.js
    +++ b/test/_30s.js
    @@ -245,11 +245,11 @@ const deepMapKeys = (obj, f) =>
         ? obj.map(val => deepMapKeys(val, f))
         : typeof obj === 'object'
           ? Object.keys(obj).reduce((acc, current) => {
    -        const val = obj[current];
    -        acc[f(current)] =
    +          const val = obj[current];
    +          acc[f(current)] =
                 val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
    -        return acc;
    -      }, {})
    +          return acc;
    +        }, {})
           : obj;
     const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
     const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
    @@ -272,9 +272,9 @@ const dig = (obj, target) =>
       target in obj
         ? obj[target]
         : Object.values(obj).reduce((acc, val) => {
    -      if (acc !== undefined) return acc;
    -      if (typeof val === 'object') return dig(val, target);
    -    }, undefined);
    +        if (acc !== undefined) return acc;
    +        if (typeof val === 'object') return dig(val, target);
    +      }, undefined);
     const digitize = n => [...`${n}`].map(i => parseInt(i));
     const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0);
     const drop = (arr, n = 1) => arr.slice(n);
    @@ -347,8 +347,8 @@ const extendHex = shortHex =>
     const factorial = n =>
       n < 0
         ? (() => {
    -      throw new TypeError('Negative numbers are not allowed!');
    -    })()
    +        throw new TypeError('Negative numbers are not allowed!');
    +      })()
         : n <= 1
           ? 1
           : n * factorial(n - 1);
    @@ -658,6 +658,9 @@ const isValidJSON = str => {
         return false;
       }
     };
    +const isWeekday = (t = new Date()) => {
    +  return t.getDay() >= 1 && t.getDay() <= 5;
    +};
     const isWritableStream = val =>
       val !== null &&
       typeof val === 'object' &&
    @@ -1004,9 +1007,9 @@ const reject = (pred, array) => array.filter((...args) => !pred(...args));
     const remove = (arr, func) =>
       Array.isArray(arr)
         ? arr.filter(func).reduce((acc, val) => {
    -      arr.splice(arr.indexOf(val), 1);
    -      return acc.concat(val);
    -    }, [])
    +        arr.splice(arr.indexOf(val), 1);
    +        return acc.concat(val);
    +      }, [])
         : [];
     const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
     const renameKeys = (keysMap, obj) =>
    @@ -1541,4 +1544,4 @@ const speechSynthesis = message => {
     const squareSum = (...args) => args.reduce((squareSum, number) => squareSum + Math.pow(number, 2), 0);
     
     
    -module.exports = {CSVToArray,CSVToJSON,JSONToFile,JSONtoCSV,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allEqual,any,approximatelyEqual,arrayToCSV,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,checkProp,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compactWhitespace,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,counter,createDirIfNotExists,createElement,createEventHub,currentURL,curry,dayOfYear,debounce,decapitalize,deepClone,deepFlatten,deepFreeze,deepGet,deepMapKeys,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,dig,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementContains,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterFalsy,filterNonUnique,filterNonUniqueBy,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formToObject,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getImages,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,hz,inRange,indentString,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,initializeNDArray,insertAfter,insertBefore,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isAfterDate,isAnagram,isArrayLike,isBeforeDate,isBoolean,isBrowser,isBrowserTabFocused,isDivisible,isDuplexStream,isEmpty,isEven,isFunction,isLowerCase,isNegativeZero,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isReadableStream,isSameDate,isSorted,isStream,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,isWritableStream,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapNumRange,mapObject,mapString,mapValues,mask,matches,matchesWith,maxBy,maxDate,maxN,median,memoize,merge,midpoint,minBy,minDate,minN,mostPerformant,negate,nest,nodeListToArray,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,offset,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,pad,palindrome,parseCookie,partial,partialRight,partition,percentile,permutations,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prefix,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,recordAnimationFrames,redirect,reduceSuccessive,reduceWhich,reducedFilter,reject,remove,removeNonASCII,renameKeys,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,serializeForm,setStyle,shallowClone,shank,show,shuffle,similarity,size,sleep,smoothScroll,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,stableSort,standardDeviation,stringPermutations,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toHash,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toTitleCase,toggleClass,tomorrow,transform,triggerEvent,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,uniqueElementsBy,uniqueElementsByRight,uniqueSymmetricDifference,untildify,unzip,unzipWith,validateNumber,vectorDistance,when,without,words,xProd,yesNo,yesterday,zip,zipObject,zipWith,JSONToDate,binarySearch,celsiusToFahrenheit,cleanObj,collatz,countVowels,factors,fahrenheitToCelsius,fibonacciCountUntilNum,fibonacciUntilNum,heronArea,howManyTimes,httpDelete,httpPut,isArmstrongNumber,isSimilar,kmphToMph,levenshteinDistance,mphToKmph,pipeLog,quickSort,removeVowels,solveRPN,speechSynthesis,squareSum}
    \ No newline at end of file
    +module.exports = {CSVToArray,CSVToJSON,JSONToFile,JSONtoCSV,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allEqual,any,approximatelyEqual,arrayToCSV,arrayToHtmlList,ary,atob,attempt,average,averageBy,bifurcate,bifurcateBy,bind,bindAll,bindKey,binomialCoefficient,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,castArray,chainAsync,checkProp,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compactWhitespace,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,counter,createDirIfNotExists,createElement,createEventHub,currentURL,curry,dayOfYear,debounce,decapitalize,deepClone,deepFlatten,deepFreeze,deepGet,deepMapKeys,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,dig,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementContains,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterFalsy,filterNonUnique,filterNonUniqueBy,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formToObject,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getImages,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,hz,inRange,indentString,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,initializeNDArray,insertAfter,insertBefore,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isAfterDate,isAnagram,isArrayLike,isBeforeDate,isBoolean,isBrowser,isBrowserTabFocused,isDivisible,isDuplexStream,isEmpty,isEven,isFunction,isLowerCase,isNegativeZero,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isReadableStream,isSameDate,isSorted,isStream,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,isWeekday,isWritableStream,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapNumRange,mapObject,mapString,mapValues,mask,matches,matchesWith,maxBy,maxDate,maxN,median,memoize,merge,midpoint,minBy,minDate,minN,mostPerformant,negate,nest,nodeListToArray,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,offset,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,pad,palindrome,parseCookie,partial,partialRight,partition,percentile,permutations,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prefix,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,recordAnimationFrames,redirect,reduceSuccessive,reduceWhich,reducedFilter,reject,remove,removeNonASCII,renameKeys,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,serializeForm,setStyle,shallowClone,shank,show,shuffle,similarity,size,sleep,smoothScroll,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,stableSort,standardDeviation,stringPermutations,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toHash,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toTitleCase,toggleClass,tomorrow,transform,triggerEvent,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,uniqueElementsBy,uniqueElementsByRight,uniqueSymmetricDifference,untildify,unzip,unzipWith,validateNumber,vectorDistance,when,without,words,xProd,yesNo,yesterday,zip,zipObject,zipWith,JSONToDate,binarySearch,celsiusToFahrenheit,cleanObj,collatz,countVowels,factors,fahrenheitToCelsius,fibonacciCountUntilNum,fibonacciUntilNum,heronArea,howManyTimes,httpDelete,httpPut,isArmstrongNumber,isSimilar,kmphToMph,levenshteinDistance,mphToKmph,pipeLog,quickSort,removeVowels,solveRPN,speechSynthesis,squareSum}
    \ No newline at end of file