JavaScript
  • JavaScript Introduction
  • JS Engine
  • V8 Engine
  • First-class function
  • Optimized Code
  • Call Stack & Memory heap
  • Single Thread
  • JavaScript RunTime
  • Nodejs
  • Context and Environment
  • Hoisting
  • Functions
  • Arguments
  • Variables
  • Scope
  • IIFE
  • this
  • call(), apply() and bind()
  • currying
  • Types
  • Type Coercion
  • Functions as Object
  • HOF (Higher Order Function)
  • Two pillars of Javascript
  • Closures
  • Prototypal Inheritance
  • OOP and FP
  • OOP
    • 4 principles of OOP
  • FP
    • Pure function
    • Imperative vs Declarative
    • Immutability
    • HOF and Closures
    • Currying
    • Partial Application
    • Compose and Pipe
  • Composition vs Inheritance
  • OOP vs FP
  • JS working
  • Promises
  • Async Await
  • ES5 - ECMAScript 2009
  • ES6 - ECMAScript 2015
  • ES7 - ECMAScript 2016
  • ES8 - ECMAScript 2017
  • ES9 - ECMAScript 2018
  • ES10 - ECMAScript 2019
  • ES11 - ECMAScript 2020
  • ES12 - ECMAScript 2021
  • JOB Queue
  • Promises Execution
Powered by GitBook
On this page

Was this helpful?

  1. FP

Partial Application

Partial Application is a way for us to partially apply a function.

It is a process of producing a function with a smaller number of parameters. That means taking a function, applying some of it's argument in to the function and uses closures for later on calling the rest of the arguments.

Ex:
// curried varsion
const curriedMultiply = (a) => (b) => (c) => a * b * c;
curriedMultiply(5)(2)(2); // 20

// Partial Application
const multiply = (a, b, c) => a * b * c;
const partialMutliplyBy5 = multiply.bind(null, 5);
partialMutliplyBy5(2, 2) // 20
PreviousCurryingNextCompose and Pipe

Last updated 5 years ago

Was this helpful?