hamaXD

6

Jan 24th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // จงเปลี่ยน ฟังก์ชันต่อไปนี้ เป็นแบบ arrow function
  2. // 1. setTimeout(function() { console.log("done"); }, 10000)
  3. // 2. function CurriedAdd(x){
  4. // return function(y){ return x+y}
  5. // };
  6. //  3. function sum3(x) {
  7. // return (y) => {
  8. //  return (z) => {
  9. //  return x + y + z;
  10. //  };
  11. // };
  12. // }
  13. // console.log(sum3(1)(2)(3)) // 6
  14. //1
  15. setTimeout(()=>{
  16.     console.log("done");
  17. },10000)
  18. // //2
  19. var CurriedAdd = x => y => x+y
  20. console.log(CurriedAdd(1)(2))
  21. // //3
  22. let sum3 = x => y => z => x+y+z
  23. console.log(sum3(1)(2)(3))
Add Comment
Please, Sign In to add comment