Skip to content

Instantly share code, notes, and snippets.

@nickchobotar
Forked from Hugoberry/closureExample.ts
Created April 27, 2018 06:00
Show Gist options
  • Save nickchobotar/42d13df67d5396e398ef6f1ae5f14b6e to your computer and use it in GitHub Desktop.
Save nickchobotar/42d13df67d5396e398ef6f1ae5f14b6e to your computer and use it in GitHub Desktop.
[Power Query] Closures, partial application and cascading parameters
let
addTo = (x) => (y) => x + y,
//make a closure with scope x=5
addToFive = addTo(5),
//becomes addTo(5) => (y) => 5 + y
eight = addToFive(3)
in //becomes addTo(5) => (3) => 5 + 3
eight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment