Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Lily Romano
    @Lilyheart
    What’s up Eric?
    What are you…. reacting to?
    Eric Phy
    @SimplyPhy
    i’m stuck on a react/babel error…no idea how to fix it
    ha
    Lily Romano
    @Lilyheart
    So is … babel… not talking to react? How is react reacting? I’m going to go now…
    Eric Phy
    @SimplyPhy
    ha, it just tells me that it cannot read “props” of undefined. Problem is, even when i explicit define the prop, it still tells me that
    i’ll figure it out………………………………….
    Lily Romano
    @Lilyheart
    That’s odd. Time to get even.
    Eric Phy
    @SimplyPhy
    i have a feeling this is really going to be a pain in the ass
    primary issue is that i don’t know react well enough, no doubt
    Lily Romano
    @Lilyheart
    It seems react is like that. In some ways, I’m dreading learning it
    Eric Phy
    @SimplyPhy
    it really feels simple. i feel like i understand it, but i also feel like my app should work :’(
    Lily Romano
    @Lilyheart
    you’ll figure it out and it’ll be some weird esoteric nonsense.
    Eric Phy
    @SimplyPhy
    i was using this to point to props inside stateless functional components :smh: :P
    David Castner
    @davidjcastner
    This message was deleted
    Eric Phy
    @SimplyPhy
    question time!
    I have the following situation:
    function myFunc() {
      myArray.map (function(entry, index) {
        for (var i = 0; i < 9; i++) {
          if (this < that) {
            if (i === 0) {
              return “yay”;
            } else if (i === 1) {
              return “nay”;
            }
          }
        }
      })
    }
    the return value isn’t being returned
    the conditions are being met (console.log confirms), everything is running fine, except return "whatevs”; just isn’t actually returning anything.
    Lily Romano
    @Lilyheart
    maps are more @davidjcastner 's thing. I've only knowledge, I've never actually worked with them.
    Eric Phy
    @SimplyPhy
    same problem when i substitute map with forEach
    okay..i’m gaining insight…and i didn’t put enough information
    there..issue appears to be related to the fact that the inner function is returning that value to the outer function, but then the outer function doesn’t return it
    Lily Romano
    @Lilyheart
    oooh i see whatcha mean.
    Eric Phy
    @SimplyPhy
    yup got it working :D just had to do this:
    Lily Romano
    @Lilyheart
    /drumroll
    Eric Phy
    @SimplyPhy
    function myFunc() {
      var supaFreaky;
      myArray.map (function(entry, index) {
        for (var i = 0; i < 9; i++) {
          if (this < that) {
            if (i === 0) {
              supeFreaky =  “yay”;
            } else if (i === 1) {
              supaFreaky =  “nay”;
            }
          }
        }
      })
      return supaFreaky;
    }
    Lily Romano
    @Lilyheart
    That is one way! woot!
    does this work?
    function myFunc() {
      return myArray.map (function(entry, index) {
        for (var i = 0; i < 9; i++) {
          if (this < that) {
            if (i === 0) {
              return  “yay”;
            } else if (i === 1) {
              return  “nay”;
            }
          }
        }
      })
    }
    This message was deleted
    Eric Phy
    @SimplyPhy
    haha xD
    hmmm...
    Lily Romano
    @Lilyheart
    It tried to be smart and added more graves... weird...
    I'm just mostly curious if that will work.
    Eric Phy
    @SimplyPhy
    it does
    :D
    Lily Romano
    @Lilyheart
    sweet!
    Eric Phy
    @SimplyPhy
    though sadly, because of my propTypes (react stuffs), i’d have to finagle things a bit to get it to accept an array instead of a string
    actually it’d be super easy, but my implementation is already in place, so watevs
    Lily Romano
    @Lilyheart
    lulz
    Eric Phy
    @SimplyPhy
    i might do it anyway…your way is better
    Lily Romano
    @Lilyheart
    :crown:
    Gotta get something right. Been a day filled with fail
    Eric Phy
    @SimplyPhy
    actually i would have to mess with things a bit. no need, my way works. thanks though, that was a good call :D
    Lily Romano
    @Lilyheart
    :thumbsup:
    The best way is the most efficient coding time-wise.
    Lily Romano
    @Lilyheart
    I'm mobile, but on my code above, can to you .toString attached after the final close parens? Since you said it was retuning an array?
    I'm also very tired so might be thinking wrong.
    @SimplyPhy