GithubHelp home page GithubHelp logo

packtpublishing / mastering-javascript-functional-programming Goto Github PK

View Code? Open in Web Editor NEW
75.0 6.0 45.0 87 KB

Mastering JavaScript Functional Programming, published by Packt

License: MIT License

JavaScript 99.51% HTML 0.49%

mastering-javascript-functional-programming's Issues

Chapter 7, question 7-1 confusion

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.