Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // จงเปลี่ยน ฟังก์ชันต่อไปนี้ เป็นแบบ arrow function
- // 1. setTimeout(function() { console.log("done"); }, 10000)
- // 2. function CurriedAdd(x){
- // return function(y){ return x+y}
- // };
- // 3. function sum3(x) {
- // return (y) => {
- // return (z) => {
- // return x + y + z;
- // };
- // };
- // }
- // console.log(sum3(1)(2)(3)) // 6
- //1
- setTimeout(()=>{
- console.log("done");
- },10000)
- // //2
- var CurriedAdd = x => y => x+y
- console.log(CurriedAdd(1)(2))
- // //3
- let sum3 = x => y => z => x+y+z
- console.log(sum3(1)(2)(3))
Add Comment
Please, Sign In to add comment