packtpublishing / mastering-javascript-functional-programming Goto Github PK
View Code? Open in Web Editor NEWMastering JavaScript Functional Programming, published by Packt
License: MIT License
Mastering JavaScript Functional Programming, published by Packt
License: MIT License
Hello, I went over the 7th chapter and there is a question that made me a little confused.
7.1. Sum as you will: The following exercise will help you understand some of
the concepts we dealt with in this chapter, even if you solve it without using
any of the functions we looked at. Write a sumMany() function that lets you
sum an indeterminate quantity of numbers, in the following fashion. Note that when
the function is called with no arguments, the sum is returned.
let result = sumMany((9)(2)(3)(1)(4)(3)());
The number 9
is not a function, so the error that is immediately being triggered is:
console.log((9)());
^
TypeError: 9 is not a function
Is there a typo by any chance? I trying different ways to avoid this error, but not sure if I am doing anything wrong.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.