Composition in Javascript | Javascript Interview Questions

preview_player
Показать описание

In this video, we'll explore the concept of composition function in Javascript.

More Playlists

Social Links

Video Titles
What is currying in Javascript?
Javascript Composition
Javascript Composition Functions
Javascript Interview Questions

Hashtags
#javascript #closure #currying #javascriptcurry #webdev #webdeveloper #javascriptinhindi #javascriptinterviewquestions #webdevelopment #javascriptinhindi
Рекомендации по теме
Комментарии
Автор

Key takeaways from the video:-
To compose two functions accepting two arguments, following can be done:-
function composeTwo(fn1, fn2){
return function(a, b){
return fn2(fn1(a, b));
};
}
In ES6, the same can be written as, const c2f=(fn1, fn2) => (a, b) => fn2(fn1(a, b));

and for composing unlimited functons, we can do the following:-
function compose(...fns){
return function(...values){
return fns.reduce( (a, b) => b(a), value);
};
}

FaizanKhan-gfaizank
Автор

Great Explanation, I mean Effortless, You are Natural bro

VijayDChauhaan
Автор

Bhaiya you’re best the way you narrate these complex concepts in a story way hats off❤️

VarunMalik-momr
Автор

ohhh! I am just a beginner, who was following your series, but this is the only lecture which has gone total parabola over my head. Shit! JS is

jaigangemata
Автор

leetcode par js ke problems solve kar raha tha function compositions se related question aaya youtube pe search kiya bhaiya ka video dikha aur pura concept samaz mein aagaya ab question solve karunga
👌😊

PratikPatil-yvhe
Автор

😏You Did Not Taught Us Well...

8:56 You Got Stuck...Where You Used reduceRight...

and After It You Cutted Your Video

And Solved By Making It "reduce" function... and you didn't even Mention About It...

This Is Where I Also Stuck And THinking Why Your Code Is Working And Mine


At Least Smjana To Chye Tha Ki Kyu Erroor Aa rhi thi aur kyu reduceRight Function ki jgh reduce function ka use karna pda....










Sorry, , , But You Are Teaching Next Level, , , , But I Have Head Ache rn. so please Give Answer The My q's.... if possible 🙏🏼❤

codingwave
Автор

hello ... I didnt get line number 21 ... you said b ke andar a ko wrap karna hai .... what is it .. could you please explain

amitk
Автор

sir unlimited composition ke liye console mai NaN show kar raha mai koi galti nahi hai ....I checked

sayannandi
Автор

const canFly = (obj) => ({
...obj,
fly: () => console.log("Flying high!"),
});

const canSwim = (obj) => ({
...obj,
swim: () => console.log("Swimming deep!"),
});

const bird = canFly({ name: "Eagle" });
const fish = canSwim({ name: "Shark" });

bird.fly(); // Output: "Flying high!"
fish.swim(); // Output: "Swimming deep!"

whatappstatus
Автор

can't we write like this ? type Add = (a:number, b:number) => number
const add:Add = (a, b) => a+b
type Square = (a:number) => number
const square =(a) => a*a
const flow = (f, g) => (x, y) => f(g(x, y))
const add_then_square = flow(square, add)
console.log(add_then_square(2, 4))

in functional programming first we should define the type of each method, each variable .

amankumarsharma
Автор

Bhai Square function is supposed to square a number not multiply any two numbers!

mohammedshahed
Автор

mai next js ka latest version ka use karke ek full stack e-commerce webapp ka tutorial banane ka soch raha hu iss video me html, css, javascript, node js, mongodb, redis, redux toolkit, cloudnery sabhi ka use kab, kyo, aur kaise ek sath use karna sikhenge aur iss app ko vercel ke server par free me deploy bhi karega agar mere comment me 200 likes  hota hai to Mujhe YouTube par video banane ka motivation milega

mrharshad