Ad
  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    Hey, I love this solution! I was trying to use a recursive function myself, but I was too much of a newbie to figure it out. One thing that is puzzling me though is why the list built from back to front? To be more specific, why is the order in which the list is built like this:

    []
    [3]
    [2, 3]
    [1, 2, 3].

  • Custom User Avatar

    For the other newbies out there, this information was critical for me to solve this:

    "p" refers the function that is being passed (AKA isGreaterThanZero or isLessThanZero)

    "this" refers to the array

    jah bless

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You are a champion, thank you so much! Seriously can't tell you how much I appreciate all of your help, you rock. I wasn't getting that it was a for...of loop, not a regular for loop, but I totally get it now. Thank you again for all of your helpful, speedy replies.

  • Custom User Avatar

    Thank you so much for al your help, I hope my questions are not bothersome. I had looked at the page you linked on the MDN prior my first comment, but I didn't see anything in there about doing something like you did. Is the "x of this" the condition of the for loop or something like that? I can't find any example like "x of this" that on the MDN page.

  • Custom User Avatar

    Thank you so much for the explanation! Is there a term a can search, or place you can link to learn more about this and other types of for loops? All I've found is the "for (initialization; condition; final expression)" type, so to speak. This makes me feel like there are other ways of using for loops I'm unfamiliar with, but I just don't know what to call them, or how to search for them. Thanks again for the great explanation.

  • Custom User Avatar

    Hey, I'm a newbie trying to understand this code. Is the "for (x of this)" a for loop? I've never seen one like this before, and can't find much about it from MDN and Google searches. Is "x of this" and initialization, condition, or somethine else entirely? Could someone explain, as explicitly and clearly as possible, what's going on there?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Wow! Thank you so much, jacobb and wthit56! This was incredibly helpful. I really appreciate you giving me such thorough explanations, and examples. Y'all are awesome!

    As a follow-up question: is it best practice to "protect" your code by using closures, or is it just something that is useful for certain specific instances?

  • Custom User Avatar

    Thank you so much! This was incredibly helpful. I really appreciate you giving me such a thorough and detailed explanation. I totally understand now.

  • Custom User Avatar

    Jenny <3 Johnny

  • Loading more items...