Coder Social home page Coder Social logo

js-closures's Issues

Problem 4 (counterFactory) should we have example returns after like the previous problem?

@jrobber These instructions refer to the "module pattern" but don't really explain what that means. Furthermore, that is a vague term. A student also pointed out that in programming you usually know what you want the outcome to be and you use your tools to get there, so he would have appreciated example return values on this one just like the previous one, like so:

var counter = counterFactory(10);
counter.inc(); // 11
counter.dec(); // 10
counter.dec(); // 9

Problem 7 (second to last one; i.e. the setTimeout one) needs better instructions

@jrobber While it is helpful to have the newScope function there as a hint, the vast majority of students still need hand-holding all the way through this one, myself included when I first encountered it. Maybe we should go as far as to point out that the anonymous function definition we are passing in on lines 203-205 is no sufficient and we need to harness a return value from newScope (which would have its own fixed closure) to get this to work.

Problem 8 needs removal or instructions need clarification

The line
*Hint: Don't let this fool you. Break down what's really happening here.
Should read something like:
*Hint: Don't let this fool you. Break down what's really happening here. The length of the array is 6 (i.e. it's not infinite).

Problem 6 (privateMethod, publicMethod) needs clarification

@jrobber Probably something like this:

/* Inside the return object create a publicMethod property that is a function that
invokes privateMethod and returns the value you get from invoking it. After you 
create the privateMethod, invoke it by calling module.publicMethod(); outside 
the module scope */

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.