These are chat archives for FreeCodeCamp/HelpJavaScript

20th
Aug 2018
Eric Wang
@bigbigDreamer
Aug 20 2018 02:02
@Pagnito I can't translate what you said. I don't quite understand what you said
Perhaps I can help you
Pagnito
@Pagnito
Aug 20 2018 02:02
Prettier is a plugin in for atom
It restructures ur code to make it look more readable
But some things it does are really annoying
Eric Wang
@bigbigDreamer
Aug 20 2018 02:10
I'm sorry I haven't used this tool, but my initial code style configuration followed the 'code neatness' book to write the code, so later on, it's no problem.
Pagnito
@Pagnito
Aug 20 2018 02:39
a somone explain this bullshit to me
Screen Shot 2018-08-19 at 10.38.47 PM.png
Screen Shot 2018-08-19 at 10.39.04 PM.png
Screen Shot 2018-08-19 at 10.38.33 PM.png
Eric Wang
@bigbigDreamer
Aug 20 2018 02:46
@Pagnito In the state of the parent component, there are no docs in response
Pagnito
@Pagnito
Aug 20 2018 02:48
Screen Shot 2018-08-19 at 10.48.00 PM.png
Eric Wang
@bigbigDreamer
Aug 20 2018 02:48
Simulate the state of your parent component, pass it to the child component, and get it through props
Pagnito
@Pagnito
Aug 20 2018 02:49
docs are inside the docs
i mean docs are inside response
Eric Wang
@bigbigDreamer
Aug 20 2018 02:50
I want to see your source code, including the state of articles
Pagnito
@Pagnito
Aug 20 2018 02:53
oh i see what u r sainy
Eric Wang
@bigbigDreamer
Aug 20 2018 02:54
Oh? Isn't it?
Oh, I'm sorry, I did a simple simulation test. I'm ok on my side, but I'm not sure. What's wrong with you
@Pagnito
Pagnito
@Pagnito
Aug 20 2018 03:08
Screen Shot 2018-08-19 at 11.07.36 PM.png
Screen Shot 2018-08-19 at 11.08.12 PM.png
Screen Shot 2018-08-19 at 11.08.12 PM.png
Screen Shot 2018-08-19 at 11.09.24 PM.png
Aditya
@ezioda004
Aug 20 2018 03:14
@Pagnito Have you set some initial value to this.props.articles?
Pagnito
@Pagnito
Aug 20 2018 03:17
Screen Shot 2018-08-19 at 11.16.52 PM.png
i can liteerraly console.log this.props.articles[0] and get an article but cant map over the array
Pagnito
@Pagnito
Aug 20 2018 03:25
omfg wtf is up with this api
i never had so much trouble with objects, like this shit is mad simple i dunno y this isnt working
apperently its still an object
Pagnito
@Pagnito
Aug 20 2018 04:05
dont know why it appeared as an array in console but yea i had to use object.keys to map it
Claudio Restifo
@Marmiz
Aug 20 2018 04:41
you can easily check if something is of type Array with Array.isArray()
Pagnito
@Pagnito
Aug 20 2018 04:53
yea i neded up use typeof
alpox
@alpox
Aug 20 2018 04:57
@Pagnito typeof is not accurate for this. It shows arrays as type "object"
Claudio Restifo
@Marmiz
Aug 20 2018 04:57
mind that in JS
typeof []  // "object"
typeof {}  // "object"
Pagnito
@Pagnito
Aug 20 2018 04:57
yea but javascript treated it as an object
even tho it showed as an array in console
i had to map over with object.keys
alpox
@alpox
Aug 20 2018 04:58
@Pagnito every array is also an object. Better test if it is a real array or not
Pagnito
@Pagnito
Aug 20 2018 04:58
yea now i def will
alpox
@alpox
Aug 20 2018 04:59
@Pagnito also, check that mapStateToProps is setup right
Pagnito
@Pagnito
Aug 20 2018 04:59
yea true
alpox
@alpox
Aug 20 2018 05:00
You could be trying to access an articles in your state at the wrong place
Pagnito
@Pagnito
Aug 20 2018 05:04
yea that was a problem for a few min too
its behind me now tho, i mapped everything, working on the visual part now
Mohammed Boudad
@matrixersp
Aug 20 2018 14:01
Hey guys, I solved this by passing s as a parameter. Is there a way to solve it without passing an array as a parameter?
// the global Array
var s = [23, 65, 98, 5];

Array.prototype.myMap = function(arr, callback){
  var newArray = [];
  // Add your code below this line
  for(let i = 0; i < arr.length; i++) {
    newArray.push(callback(arr[i]))
  }  
  // Add your code above this line
  return newArray;

};

var new_s = s.myMap(s, function(item){
  return item * 2;
});
Chris
@crokita
Aug 20 2018 14:05
@matrixersp you should be able to access the array by referencing this inside the myMap function
Mohammed Boudad
@matrixersp
Aug 20 2018 14:08
@crokita Thanks! That's what I was looking for
Chris
@crokita
Aug 20 2018 14:08
mhmm
tundeiness
@tundeiness
Aug 20 2018 14:58
Hi guys I am trying to check if a particular property and value exist in an object but it's been tricky of late. How do I go about it? and How will I handle if a particular property is not available or a value isn't available?
might get you started
tundeiness
@tundeiness
Aug 20 2018 15:03
@moT01 yeah I used hasOwnPropety but the result I was expecting wasn't what I got.
Tom
@moT01
Aug 20 2018 15:04
what were you expecting - and what did you get
it should be used to see if the object has that key
here's something that looks like it might help to check for values https://stackoverflow.com/questions/35948669/how-to-check-if-value-exists-in-object-using-javascript
Christopher McCormack
@cmccormack
Aug 20 2018 15:06
morning :wave:
Jason Luboff
@JLuboff
Aug 20 2018 15:11
@cmccormack morning
Christopher McCormack
@cmccormack
Aug 20 2018 15:12
@JLuboff what's up man? Good weekend?
Jason Luboff
@JLuboff
Aug 20 2018 15:12
Just got into work.. checking emails, etc. Weekend wasn't too bad, yourself?\
Christopher McCormack
@cmccormack
Aug 20 2018 15:16
Good man, went to valley, too hot, ate too much food, spent time with some family.
Back in the mountains where it isn't 110
tundeiness
@tundeiness
Aug 20 2018 15:17
@moT01 will check it out
Jason Luboff
@JLuboff
Aug 20 2018 15:18
@cmccormack Nice
Tom
@moT01
Aug 20 2018 15:18
:loudspeaker:
Christopher McCormack
@cmccormack
Aug 20 2018 15:19
@moT01 heya
Tom
@moT01
Aug 20 2018 15:19
i just like to throw random emojis out there - which gives me an idea, a random emoji generator
Christopher McCormack
@cmccormack
Aug 20 2018 15:22
:poop:
Jason Luboff
@JLuboff
Aug 20 2018 15:23
:poop:
Christopher McCormack
@cmccormack
Aug 20 2018 15:29
I thought about making a simple Electron App that made it super simple to search for an emoji and copy it to clipboard
maybe we can make that and include a random option
Jason Luboff
@JLuboff
Aug 20 2018 15:31
I've been thinking about creating an Electron app as well
Christopher McCormack
@cmccormack
Aug 20 2018 15:31
It's official, we just started our own Splinter Cell, running counter to FCC with our own projects and exercises!
ledgecorp
@ledgecorp
Aug 20 2018 15:32
newBie
Jason Luboff
@JLuboff
Aug 20 2018 15:35
@cmccormack Don't get carried away now
Christopher McCormack
@cmccormack
Aug 20 2018 15:37
hmm yeah I tend to overreach
These wax wings are so shiny though!
Jason Luboff
@JLuboff
Aug 20 2018 15:38
Now you totally lost me :P
Chris
@crokita
Aug 20 2018 15:40
lol
Christopher McCormack
@cmccormack
Aug 20 2018 15:42
Daedalus fashioned two pairs of wings out of wax and feathers for himself and his son. Daedalus tried his wings first, but before trying to escape the island, he warned his son not to fly too close to the sun, nor too close to the sea, but to follow his path of flight. Overcome by the giddiness that flying lent him, Icarus soared into the sky, but in the process he came too close to the sun, which due to the heat melted the wax.
Jason Luboff
@JLuboff
Aug 20 2018 15:48
Oh you're talking about my homie Icarus
宋少卿
@songshaoqing
Aug 20 2018 15:49
what?
Christopher McCormack
@cmccormack
Aug 20 2018 16:14
@JLuboff yeah man!
Jason Luboff
@JLuboff
Aug 20 2018 16:22
@cmccormack Busy work day?
Christopher McCormack
@cmccormack
Aug 20 2018 16:24
not as bad so far, catching up on documentation today but that always leads into a rats nest of other issues I find that I need to fix
@JLuboff how about you?
Jason Luboff
@JLuboff
Aug 20 2018 16:27
Ya sort of. Have another meeting this afternoon for my work project. Bullshit stuff they want lol.
Christopher McCormack
@cmccormack
Aug 20 2018 16:27
:no_entry_sign:
Just say no
Or assign ridiculous point values and tell them it will be 3000 points, can you afford it right now?
Jason Luboff
@JLuboff
Aug 20 2018 16:28
Hah...I wish. Still waiting to talk to my boss about NO
Christopher McCormack
@cmccormack
Aug 20 2018 16:28
yay
Could always say something like"We're only accepting bug fixes and important feature requests right now"
For all other requests, submit an issue on bitbucket haha
Jason Luboff
@JLuboff
Aug 20 2018 16:32
Eh...luckily I dreamed up a solution that isn't a lot of work for me for something they wanted :joy:
Christopher McCormack
@cmccormack
Aug 20 2018 16:36
isn't that great when you solve problems in your sleep??
Jason Luboff
@JLuboff
Aug 20 2018 16:36
Yes and no..
Jason Luboff
@JLuboff
Aug 20 2018 17:39
Apparently there are "Snowflake Schema's" in MS SQL... so... are they millenials?
Christopher McCormack
@cmccormack
Aug 20 2018 17:45
har har
Jason Luboff
@JLuboff
Aug 20 2018 17:46
;)
Brad
@bradtaniguchi
Aug 20 2018 18:20
I have a quick question for mongoDb, if I'm running db operators in a shell that are only supported in v3.4, I'm fine using those operators from JS right?
Jason Luboff
@JLuboff
Aug 20 2018 18:21
I don
't see why not
Pagnito
@Pagnito
Aug 20 2018 18:28
anyone have trouble with unever fraction sizes in grid css
its rly annoying
Brad
@bradtaniguchi
Aug 20 2018 18:29
Yea i think I'm safe, just don't want to deploy and get a "surprise" hehe
Pagnito
@Pagnito
Aug 20 2018 18:29
when i minimize my screen only some of the fractions get smaller
Jason Luboff
@JLuboff
Aug 20 2018 18:42
@bradtaniguchi That what testing is for...right..? :P
Brad
@bradtaniguchi
Aug 20 2018 18:42
um.... :P
Jason Luboff
@JLuboff
Aug 20 2018 18:52
:smile:
Brad
@bradtaniguchi
Aug 20 2018 19:42
Guys I think I'm going to become a backend dev, screw the front-end :P
Jason Luboff
@JLuboff
Aug 20 2018 19:42
Welcome
I too say screw the front-end
Pagnito
@Pagnito
Aug 20 2018 19:42
how come u guy dont like front end
Brad
@bradtaniguchi
Aug 20 2018 19:43
I suck at the design aspect XD
Jason Luboff
@JLuboff
Aug 20 2018 19:43
I'm not creative enough lol plus I just don't know enough CSS on its own..I end up using frameworks
Brad
@bradtaniguchi
Aug 20 2018 19:43
same here
Pagnito
@Pagnito
Aug 20 2018 19:43
ah
yea im the opposite >.<
i love front end
im gonna master animations
Brad
@bradtaniguchi
Aug 20 2018 19:43
But I like the challenge of making things as optimal as possible, and testing litterally everything. Front-end performance isn't tha timportant and testing is hard AF
Pagnito
@Pagnito
Aug 20 2018 19:43
make as optimal animations as possible
Brad
@bradtaniguchi
Aug 20 2018 19:44
But for now, I'll just call myself full stack :trollface:
Pagnito
@Pagnito
Aug 20 2018 19:44
a bad front end tho can fck up ur whole business
Jason Luboff
@JLuboff
Aug 20 2018 19:44
I'm technically full stack as well
Brad
@bradtaniguchi
Aug 20 2018 19:44
full-stack cool kids :P
Pagnito
@Pagnito
Aug 20 2018 19:44
lol
Brad
@bradtaniguchi
Aug 20 2018 19:45
Yea I agree about having a bad front-end is still bad
Brad
@bradtaniguchi
Aug 20 2018 20:00
The only thing with the backend I dont like is the idea of having to manage databases :/ I do like the idea of learning docker tho
Jason Luboff
@JLuboff
Aug 20 2018 21:22
@bradtaniguchi Databases aren't too bad...just depends on how deep you're getting with them
Brad
@bradtaniguchi
Aug 20 2018 21:33
I mean, I'd see myself having to deal with some database design :?
Jason Luboff
@JLuboff
Aug 20 2018 21:35
Yes naturally
Brad
@bradtaniguchi
Aug 20 2018 22:19
It would be nice if the original guy who closed all these github issues referenced the commit he did it in :/
Jason Luboff
@JLuboff
Aug 20 2018 22:21
Psh ya right
Philip Durbin
@pdurbin
Aug 20 2018 22:23
What github issues?
Brad
@bradtaniguchi
Aug 20 2018 22:26
@pdurbin on my project at work haha. All of them are just "closed", so Id need to look at the date, and the commit messages manually to identify when he fixed an issue
Philip Durbin
@pdurbin
Aug 20 2018 22:30
Ah. Ok.
Moisés Man
@moigithub
Aug 20 2018 23:05
Went yo a Junior Dev inteerview ... And i was thinking HTML CSS Javascript.... But they asked me yo do a crud using apollo client / graphql and react.,.
Jason Luboff
@JLuboff
Aug 20 2018 23:06
@moigithub That seems a bit more than Junior dev work... but then again..I haven't looked at dev job descriptions lol. How'd it go?
Moisés Man
@moigithub
Aug 20 2018 23:07
Tookn me 5 hours yo complete.. Lot of googling
Jason Luboff
@JLuboff
Aug 20 2018 23:09
Sounds intense
Moisés Man
@moigithub
Aug 20 2018 23:11
But he said he wanted the edit feature on sepárate Window i put eveeything allí together...
Job DESC was junior Dev with knowledge on Any of this tech. React Django angular reactnative
Jason Luboff
@JLuboff
Aug 20 2018 23:15
Well do you think you got the job?
Moisés Man
@moigithub
Aug 20 2018 23:58
Dunno. He gave me 3 hours to. Complete.. and i toook 5.. solo if think cost per hour...probably i was too slow