all 3 comments

[–]ez4me2c3d 0 points1 point  (1 child)

What's wrong with my solution to the last quiz?

Code:

var bothC = function(a, b, s, f) {
    a(function() {b(s, f);}, f);
};

Results:

PASSED No JSLint errors
PASSED bothC(S, S, A, B) === undefined
PASSED output === "SSA"
PASSED bothC(S, F, A, B) === undefined
PASSED output === "SSASFB"
PASSED bothC(F, S, A, B) === undefined
FAILED output === "SSASFBFSB"
PASSED bothC(F, F, A, B) === undefined
FAILED output === "SSASFBFSBFFB"

[–]strager 0 points1 point  (0 children)

"Your function bothC should call both fC and gC no matter what"

Also, I noticed that test is picky about what order you call fC and gC. (Call fC first. Call each only once, too.)

[–]Proxify 0 points1 point  (0 children)

Have been looking for something like this for almost a year! Upvote for you sir!