These are chat archives for MontCode/GeneralChat

6th
Oct 2016
Eric Phy
@SimplyPhy
Oct 06 2016 15:18
ugh.
Lily Romano
@Lilyheart
Oct 06 2016 15:18
What’s up Eric?
What are you…. reacting to?
Eric Phy
@SimplyPhy
Oct 06 2016 15:18
i’m stuck on a react/babel error…no idea how to fix it
ha
Lily Romano
@Lilyheart
Oct 06 2016 15:19
So is … babel… not talking to react? How is react reacting? I’m going to go now…
Eric Phy
@SimplyPhy
Oct 06 2016 15:20
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
Oct 06 2016 15:21
That’s odd. Time to get even.
Eric Phy
@SimplyPhy
Oct 06 2016 15:25
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
Oct 06 2016 15:25
It seems react is like that. In some ways, I’m dreading learning it
Eric Phy
@SimplyPhy
Oct 06 2016 15:27
it really feels simple. i feel like i understand it, but i also feel like my app should work :’(
Lily Romano
@Lilyheart
Oct 06 2016 15:32
you’ll figure it out and it’ll be some weird esoteric nonsense.
Eric Phy
@SimplyPhy
Oct 06 2016 21:03
i was using this to point to props inside stateless functional components :smh: :P
David Castner
@davidjcastner
Oct 06 2016 21:23
This message was deleted
Eric Phy
@SimplyPhy
Oct 06 2016 22:51
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
Oct 06 2016 22:56
maps are more @davidjcastner 's thing. I've only knowledge, I've never actually worked with them.
Eric Phy
@SimplyPhy
Oct 06 2016 22:57
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
Oct 06 2016 23:00
oooh i see whatcha mean.
Eric Phy
@SimplyPhy
Oct 06 2016 23:07
yup got it working :D just had to do this:
Lily Romano
@Lilyheart
Oct 06 2016 23:07
/drumroll
Eric Phy
@SimplyPhy
Oct 06 2016 23:08
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
Oct 06 2016 23:08
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
Oct 06 2016 23:08
haha xD
hmmm...
Lily Romano
@Lilyheart
Oct 06 2016 23:09
It tried to be smart and added more graves... weird...
I'm just mostly curious if that will work.
Eric Phy
@SimplyPhy
Oct 06 2016 23:12
it does
:D
Lily Romano
@Lilyheart
Oct 06 2016 23:12
sweet!
Eric Phy
@SimplyPhy
Oct 06 2016 23:12
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
Oct 06 2016 23:13
lulz
Eric Phy
@SimplyPhy
Oct 06 2016 23:13
i might do it anyway…your way is better
Lily Romano
@Lilyheart
Oct 06 2016 23:15
:crown:
Gotta get something right. Been a day filled with fail
Eric Phy
@SimplyPhy
Oct 06 2016 23:16
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
Oct 06 2016 23:17
:thumbsup:
The best way is the most efficient coding time-wise.
Lily Romano
@Lilyheart
Oct 06 2016 23:56
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
Eric Phy
@SimplyPhy
Oct 06 2016 23:59
hmmmm, might work