Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const plus = x => y => x + y;
- const multiplyThenPlusWidth = x => y => plusWidth(x * y);
- const multiplyByTwoThenPlusWidth = multiplyThenPlusWidth(2);
- // plusWidth() not initialised yet
- console.log(multiplyByTwoThenPlusWidth(5)); // works??
- const main = (() => {
- // User input:
- const w = 3;
- const plusWidth = plus(w);
- console.log(multiplyByTwoThenPlusWidth(5));
- })() // iife
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement