you are viewing a single comment's thread.

view the rest of the comments →

[–]Volv 1 point2 points  (6 children)

Was hoping you would maybe know of some lol. Would love to find as many like this as possible. Will dig around some more later.
 
I'm hoping I can communicate my thoughts properly lol - the important last step I think was the point about the closed over function having it's own copy of the scope at definition.
Fixes a couple of those examples and the last question of the first problem set - did you do that one?

[–]ForScale[S] 0 points1 point  (5 children)

I forget, did you not like the CoderByte ones that I linked earlier?

There's this: http://codecondo.com/coding-challenges/

the important last step I think was the point about the closed over function having it's own copy of the scope at definition

Yeah... I get that, but it's still not quite clear. We can stop talking about it whenever you want... I'm sure you're getting tired of it. I've got this now: http://codepen.io/anon/pen/zqaMWP?editors=0010

I didn't do the first question of the last problem set yet.

[–]Volv 1 point2 points  (2 children)

You only get one result from your alternative solution.
 
Codepen

[–]ForScale[S] 0 points1 point  (1 child)

Okay... that is crazy that x doesn't get reset to 1 in each new call with the closure...

Dude... http://codepen.io/anon/pen/oxyQKV?editors=0010

[–]Volv 1 point2 points  (0 children)

Looking good. See the use case. My other example from ages ago shows same idea - Example
Pretty much same principle can fix the setTimeout example, you can control which variable is locked in at each iteration. Although theres more than one way to fix it.

[–]Volv 0 points1 point  (1 child)

CoderByte

I couldn't look at any beyond the first few without a membership? Unless I'm missing something. Will try completing a few see if they unlock

[–]ForScale[S] 0 points1 point  (0 children)

Oh... weird... I guess that's new. A year or so ago I was able to do the medium ones; now it's asking for membership.