31st
Oct 2018
kinopotato
@kinopotato
Oct 31 2018 01:34
Hello, in FCC as an example this is written
function reverseAlpha(arr) {
return arr.sort(function(a, b) {
return a < b;
});
}
reverseAlpha(['l', 'h', 'z', 'b', 's']);
// Returns ['z', 's', 'l', 'h', 'b']
but it's not working. is this a bug? it returns the same array
this other example from the same challenge works though
function ascendingOrder(arr) {
return arr.sort(function(a, b) {
return a - b;
});
}
ascendingOrder([1, 5, 2, 3, 4]);
// Returns [1, 2, 3, 4, 5]
Christopher McCormack
@cmccormack
Oct 31 2018 01:36
```
Code
```
That's three backticks (grave accents, usually on the [~] key, on their own line
kinopotato
@kinopotato
Oct 31 2018 01:36
```function reverseAlpha(arr) { return arr.sort(function(a, b) { return a < b; }); } reverseAlpha(['l', 'h', 'z', 'b', 's']); // Returns ['z', 's', 'l', 'h', 'b']```
``````function reverseAlpha(arr) {
return arr.sort(function(a, b) {
return a < b;
});
}
reverseAlpha(['l', 'h', 'z', 'b', 's']);
// Returns ['z', 's', 'l', 'h', 'b']``````
oh there it is
so that doesn't work but that's the example in the challenge, it returns the same array
``````function ascendingOrder(arr) {
return arr.sort(function(a, b) {
return a - b;
});
}
ascendingOrder([1, 5, 2, 3, 4]);
// Returns [1, 2, 3, 4, 5]``````
this works though, same challenge example
@ezioda004
Oct 31 2018 01:39
@kinopotato We've updated the text in the following PR: freeCodeCamp/freeCodeCamp#25978
The problem is that Chrome v < 69 used to show correct result even for "bad" comparison function. Chrome 70+ have changed this behavior to be more consistent hence the above issue you are facing.
kinopotato
@kinopotato
Oct 31 2018 01:40
@ezioda004 ohhhh so that's why. well if it's already being updated then I guess it's all good. thanks for clarifying that!
@ezioda004
Oct 31 2018 01:40
@kinopotato To tl;dr this:
``````//BAD, dont use this
function(a, b) {
return a < b;
}
//GOOD, use this
function(a, b){
return a - b;
}``````
kinopotato
@kinopotato
Oct 31 2018 01:43
a - b are for numbers right?
@ezioda004
Oct 31 2018 01:47
Yes, for strings you'd have to do something like:
``````function (a, b){
return a < b ? 1 : -1;
}``````
kinopotato
@kinopotato
Oct 31 2018 01:48
@ezioda004 I think I got it, haha, maybe. Thanks as always dude! :D
@ezioda004
Oct 31 2018 01:49
No problem :thumbsup:
kinopotato
@kinopotato
Oct 31 2018 02:47
Hello again, just wondering why my filter function isn't working here
So I want to take an array then get rid of all the spaces
``````

// the global variable
var globalTitle = " Winter Is  Coming";

function urlSlug(title) {
return title.split(/\W/).filter(e => {
return e !== " "});

}

var winterComing = urlSlug(globalTitle); // Should be "winter-is-coming"
winterComing;``````
but the array that returns is still the same as when it was split, and filter isn't doing anything.
Christopher McCormack
@cmccormack
Oct 31 2018 02:48
then e is never equal to a space
space is a non-word character
which would match `/\W/`
kinopotato
@kinopotato
Oct 31 2018 02:49
okay, I'm with you so far.
so it matches \W and I was thinking it should be filtered with the filter()
Christopher McCormack
@cmccormack
Oct 31 2018 02:50
``````> " Winter Is  Coming".split(/\W/)
[ '', 'Winter', 'Is', '', 'Coming' ]``````
maybe, but you don't have any space character in your array
just empty strings
you can modify your filter to compare against empty strings
``return e !== " "``
kinopotato
@kinopotato
Oct 31 2018 02:51
ohhh, those aren't spaces
ohhhhhhhh
Christopher McCormack
@cmccormack
Oct 31 2018 02:51
:D
kinopotato
@kinopotato
Oct 31 2018 02:52
I thought they were spaces. do you just get used to these kinds of things?
@ezioda004
Oct 31 2018 02:53
Could use a `.match()` too, `" Winter Is Coming".match(/[^\W]+/g); // ["Winter", "Is", "Coming"]`
Christopher McCormack
@cmccormack
Oct 31 2018 02:53
yup
every mistake you run into helps you build up to new mistakes!
kinopotato
@kinopotato
Oct 31 2018 02:53
@cmccormack pretty much xD
Christopher McCormack
@cmccormack
Oct 31 2018 02:54
@kinopotato one way you could have tested that:
``````function urlSlug(title) {
return title.split(/\W/).filter(e => {
console.log(e)
return e !== " "});
}``````
kinopotato
@kinopotato
Oct 31 2018 02:54
@ezioda004 thanks dude! I was avoiding using regex because I keep using it instead of what FCC challenges want me to use xD
@ezioda004
Oct 31 2018 02:55
@kinopotato Ah I see, its still good to know how to solve a problem with different methods :smiley:
kinopotato
@kinopotato
Oct 31 2018 02:58
@ezioda004 I agree with you very much! :D I'm actually happy that I now have the problem of solving things in different ways. How do you know though when your way is the best way??

@kaikaidaren
Oct 31 2018 02:59

Christopher McCormack
@cmccormack
Oct 31 2018 03:00
did you really do not not word @ezioda004 ? :D
@ezioda004
Oct 31 2018 03:03
@kinopotato "Best" definition changes - sometimes best means in terms of performance, sometimes best means in terms of readability or even conciseness. Performance wise - if you know how algorithms work ie big O notation, you can have the basic idea of whats the fastest algorithm possible of that problem. If you can make your solution's big O same as that then thats the best solution.

@kaikaidaren
Oct 31 2018 03:05
Don't understand
@ezioda004
Oct 31 2018 03:05
@cmccormack Hah, I agree we can go deeper
kinopotato
@kinopotato
Oct 31 2018 03:05
haven't heard of big O before. I hope it's covered with the Intermediate Algorithm Scripting in FCC JS
@ezioda004
Oct 31 2018 03:06
@kaikaidaren Have you tried the Chinese room? https://gitter.im/FreeCodeCamp/chinese
@kinopotato Sadly its no - its a CS topic and fcc has real "Data Structure And Algorithms" in the coding interview section but I dont think there are lessons for big O notation.
Now that I think about it, there should be couple of lessons for big O notation in coding interview prep section.

@kaikaidaren
Oct 31 2018 03:09
@ezioda004 ok
kinopotato
@kinopotato
Oct 31 2018 03:11
@ezioda004 even junior developers need to know this? I'm going to read on it but how much do I need to know about it do you think?
@ezioda004
Oct 31 2018 03:12
@kinopotato For frontend dev?
You can probably get a junior dev job without knowing all that, but big companies take interview from these topics.
kinopotato
@kinopotato
Oct 31 2018 03:14
hmm, I want to be a freelancer if possible as well. I am assuming I can get by with little knowledge if I'm just making medium sized websites or medium complex apps?
it's not that I want to skip the reading, it's more like I need to get started on building things
@ezioda004
Oct 31 2018 03:15
You'll barely ever need knowledge of this topic while making websites lol
kinopotato
@kinopotato
Oct 31 2018 03:16
well that's already a bit of relief O.O I thought I can start making competent websites after learning JS, but half way through FCC JS I learned that I still need to learn DOM manipulation through JS which isn't covered in FCC
@ezioda004
Oct 31 2018 03:17
We have DOM manipulation.
kinopotato
@kinopotato
Oct 31 2018 03:17
front end libraries??
@ezioda004
Oct 31 2018 03:17
Yeah, its covered with jQuery though.
kinopotato
@kinopotato
Oct 31 2018 03:18
I've heard somewhere that a lot of people are moving away from jQuery tho?
@ezioda004
Oct 31 2018 03:20
Yes, you can skip jQuery and just directly learn vanilla JS DOM manipulation.
But in my experience vanilla JS DOM manipulation gets a bit easier to understand if you know some jQuery.
kinopotato
@kinopotato
Oct 31 2018 03:26
I don't understand how learning DOM manipulation using JS can be easier if you know jQuery when jQuery is a derivative of JS xD every day I learn that I know very little
@ezioda004
Oct 31 2018 03:27
Thats because jQuery was build to make DOM manipulation easier back in the day.
kinopotato
@kinopotato
Oct 31 2018 03:28
Claudio Restifo
@Marmiz
Oct 31 2018 03:30
@kinopotato you can read from Github why they decided to move away from JQuery, as @ezioda004 is telling you :)
@ezioda004
Oct 31 2018 03:30
Its more or less the same - you can check the difference here.
kinopotato
@kinopotato
Oct 31 2018 03:32
I'm going to look at this over lunch, good god I'm hungry!
Thanks as always for the info and taking the time to read! :D much appreciated!
abraham anak agung
Oct 31 2018 03:34
Made something simple with React Hooks, codepen
Niraj Nandish
@Nirajn2311
Oct 31 2018 04:56

Now that I think about it, there should be couple of lessons for big O notation in coding interview prep section.

Thats the same thing that went through my mind when I asked the same question a month or two ago

Christopher McCormack
@cmccormack
Oct 31 2018 04:59
:pencil:
@ezioda004
Oct 31 2018 05:04
Can work on those in future.
Darren
@DarrenfJ
Oct 31 2018 05:46
evening fCC
@thekholm80 life in my world is busy busy.. as you can see by me replying maaaaany hours later ;)
@Marmiz thanks for thee JQuery link.. will check it out later :smiley:
Claudio Restifo
@Marmiz
Oct 31 2018 05:52
np @DarrenfJ . Popped out on my tweeter feed a while back.
An interesting read with reason that goes way past the random hate / hype for tech :)
I liked it
@ezioda004
Oct 31 2018 05:57
@Marmiz I think I read that Node.js and jQuery (whichever foundation works on it) were merging
glitz20
@glitz20
Oct 31 2018 05:57
does anyone knows how to update multiple fields in mongoose?
@ezioda004
Oct 31 2018 05:59
glitz20
@glitz20
Oct 31 2018 06:04
@aditya my database is not updating
~~~|
this is edititem.js
``````componentDidMount() {
axios.get('/items/edit/' + this.props.match.params.id)
.then(response => {
this.setState({
title: response.data.title,
prize: response.data.prize,
introduction: response.data.introduction,
question: response.data.question
});
})
.catch(function (error) {
console.log(error);
})
}

handleChange(event) {
this.setState({ [event.target.name]: event.target.value });
}

handleSubmit(event) {
event.preventDefault();
this.addItemService.updateData({ this.state.title, this.state.prize, this.state.introduction, this.state.question }, { this.props.match.params.id });
this.props.history.push('/');
}``````
this is update function
`````` updateData(data, id) {
axios.post('/items/update/' + id, {
item: data
})
.then(res=> this.setState({ itemss: res.data }))
.catch(err => console.log(err))
}``````
and these are edit and update route
``````// Defined edit route
itemRouter.route('/edit/:id').get(function (req, res) {
var id = req.params.id;
Item.findById(id, function (err, item) {
res.json(item);
});
});

//  Defined update route
itemRouter.route('/update/:id').post(function (req, res) {
Item.findById(req.params.id, function (err, item) {
if (!item)
return next(new Error('Could not load Document'));
else {
item.title = req.body.item.title;
item.prize = req.body.item.prize;
item.introduction = req.body.item.introduction;
item.question = req.body.item.question;

item.save().then(item => {
res.json('Update complete');
})
.catch(err => {
res.status(400).send("unable to update the database");
});
}
});
});``````
glitz20
@glitz20
Oct 31 2018 06:28
@ezioda004
Darren
@DarrenfJ
Oct 31 2018 06:32
@Marmiz noice thanks man
kinopotato
@kinopotato
Oct 31 2018 07:20

Hello again, was just wondering why concat isn't working in my code

``````

function diffArray(arr1, arr2) {
let n1 = arr1.concat();
let n2 = arr2.concat();
let newArr = [];
for (let i = 0; i <= arr1.length; i++){
console.log(i);
if (n1.indexOf(n2[i]) >= 0){
console.log(n2[i]+ " n2");
console.log(n1.indexOf(n2[i]));
newArr.concat(n2[i]);
console.log(newArr + " new");
}

}
return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);``````

so when I use push, it works which I guess is alright since I am not mutating the original input, but I am wondering why concat isn't working? It's supposed to be adding the value n2[i] into the newArr right? it works with push, but not with concat :|

Anand Potukuchi
@anandpotukchi
Oct 31 2018 07:27
When i create a multi-compoennet app, I get thsi as output
`s`
in the browser
what is this supoosed to mean
@ezioda004
@Marmiz
@cmccormack
Anand Potukuchi
@anandpotukchi
Oct 31 2018 07:33
any idea
@alpox
Anand Potukuchi
@anandpotukchi
Oct 31 2018 07:40
got it!

@xiaochuanxi
Oct 31 2018 07:55

<style>

<h2 style="color:blue ">我家的猫咪
</style>
<p>在大家心目中，猫是慵懒的可爱的化身，它可以睡饱了再起来吃饭，可以逗趣小耗子，可以卖得了萌，使得了坏，这样百变的小怪兽就集结在一只宠物上，怎能不惹人怜爱。</p>
</h2>

Anand Potukuchi
@anandpotukchi
Oct 31 2018 07:56
@xiaochuanxi hello

@xiaochuanxi
Oct 31 2018 07:57
hello
i am a novice
Nicolas Ramirez
@kamatheuska
Oct 31 2018 07:58
@kinopotato the syntax is `array.concat(someOtherArray)`, I think
you aren't passing any arguments to `concat`

@xiaochuanxi
Oct 31 2018 08:05
at the beginning of learning to program,the task that the computer giverstood
goog trouble
Claudio Restifo
@Marmiz
Oct 31 2018 08:08
@xiaochuanxi have you checked the chinese room?
https://gitter.im/FreeCodeCamp/chinese
Anand Potukuchi
@anandpotukchi
Oct 31 2018 08:08
we have achneese rom?
cool
@xiaochuanxi this is better.. go to the chinese room
Claudio Restifo
@Marmiz
Oct 31 2018 08:11
@anandpotukchi what was about rendering multiple components?
Anand Potukuchi
@anandpotukchi
Oct 31 2018 09:17
nothing
solved it
Niraj Nandish
@Nirajn2311
Oct 31 2018 10:26
Can anyone with C++ experience help me out
``````#include <iostream.h>
#include <ctype.h>
#include <conio.h>

void strcon(char s[])
{
for (int i = 0, l = 0; s[i] != '\0'; i++, l++)
for (int j = 0; j < l; j++)
{
if (isupper(s[j]))
s[j] = tolower(s[j]) + 2;
else if (islower(s[j]))
s[j] = toupper(s[j]) - 2;
else
s[j] = '@';
}
}

void main()
{
clrscr();
char *c = "Romeo Joliet";
strcon(c);
cout << "Text= " << c << endl;
c = c + 3;
cout << "New Text= " << c << endl;
c = c + 5 - 2;
cout << "last Text= " << c;
getch();
}``````
The output of the above code is
``````Text= toKeM@loJiCt
New Text= eM@loJiCt
last Text= loJiCt``````
@diomed
Oct 31 2018 10:30
I don't C++
Jaka Kranjc
@lynxlynxlynx
Oct 31 2018 10:33
what's the problem?
Niraj Nandish
@Nirajn2311
Oct 31 2018 10:34
Why is it jumping to alternate letters
And not checking for each letters
I thought the answer would be:
``````Text: tMKCM@lMJGCR
New Text= CM@lMJGCR
last Text= lMJGCR``````
@diomed
Oct 31 2018 10:37
`T0K3N`
Jaka Kranjc
@lynxlynxlynx
Oct 31 2018 10:38
you have a weird nested loop, i unused
it runs more often than you probably think
Niraj Nandish
@Nirajn2311
Oct 31 2018 10:40
Wait, its a nested loop
Niraj Nandish
@Nirajn2311
Oct 31 2018 10:47
Oh got it, @lynxlynxlynx thx
@diomed
Oct 31 2018 10:50
@Nirajn2311 wtf u learning C++ for anyway?
Niraj Nandish
@Nirajn2311
Oct 31 2018 10:51
@diomed I aint learning, I have it for my finals and exams - only this year
@diomed
Oct 31 2018 10:52
oooh... hell
if you're not learning, then wtf are you doing, lol? :yum:
Niraj Nandish
@Nirajn2311
Oct 31 2018 10:53
Just learning as it is a bit similar to js in loop wise
And also I have my midterms tomorrow and our predicted scores depend on it
@diomed
Oct 31 2018 10:59
good luck in your studies, human :cat:
BuntyBru
@BuntyBru
Oct 31 2018 11:14
i have an object
``````pushin:[{
id:'22k',
name:'Johhny'
},
{
id:'22k'
name:'Johhny'
}]
Now  many times same object is pushed
Is there any way to reduce the redundancy``````
is there any method present
?
BuntyBru
@BuntyBru
Oct 31 2018 12:36
NVM
done
Oct 31 2018 13:55
Hey there! Is there anyone using Ubuntu ...I need help
Anand Potukuchi
@anandpotukchi
Oct 31 2018 13:55
@aditya2000 yeah I might be able to help
hello?
Oct 31 2018 14:11
@anandpotukchi thanks
My laptop is not showing any available WiFi connections
Anand Potukuchi
@anandpotukchi
Oct 31 2018 14:12
what is the problem
hmm
happens
Victor Popescu
@VicPopescu
Oct 31 2018 14:12
Anand Potukuchi
@anandpotukchi
Oct 31 2018 14:12
@VicPopescu uh problem is not mine
Oct 31 2018 14:13
How can I make sure that? @VicPopescu
Anand Potukuchi
@anandpotukchi
Oct 31 2018 14:13
` @aditya2000 which version are you running? 18.04?
Victor Popescu
@VicPopescu
Oct 31 2018 14:13
@anandpotukchi sry wrong click
Oct 31 2018 14:13
16.
Niraj Nandish
@Nirajn2311
Oct 31 2018 14:13
@aditya2000 are you using ubuntu in vm or it was the base os
Oct 31 2018 14:14
04
Victor Popescu
@VicPopescu
Oct 31 2018 14:14
Oct 31 2018 14:14
It was base os @Nirajn2311
I did that but got an ethernet interface instead of a wireless interface @VicPopescu
Niraj Nandish
@Nirajn2311
Oct 31 2018 14:16
Check what ipconfig shows
Anand Potukuchi
@anandpotukchi
Oct 31 2018 14:16
yo might want to uninstall and reinstall the firmware
but it's usally the last thing i'd do
`sudo apt install --reinstall linux-firmware`
Victor Popescu
@VicPopescu
Oct 31 2018 14:16
then you might not have the driver @aditya2000 ? `ifconfig -a` to see all interfaces
Oct 31 2018 14:17
And it's giving a warning that says `you should run this program as super user`
Anand Potukuchi
@anandpotukchi
Oct 31 2018 14:17
first thing disable and enable airplane mode
Victor Popescu
@VicPopescu
Oct 31 2018 14:17
make sure you use `sudo`
Anand Potukuchi
@anandpotukchi
Oct 31 2018 14:18
@VicPopescu `ifconfig` isn't working in 18.04
maybe the package is missing
Victor Popescu
@VicPopescu
Oct 31 2018 14:18
well, I am outdated :))
Niraj Nandish
@Nirajn2311
Oct 31 2018 14:19
Thats strange the last time i used ubuntu in vm it was working
@anandpotukchi are you sure nothing came for ifconfig
Anand Potukuchi
@anandpotukchi
Oct 31 2018 14:19
yeah
just did it again
doesnt exist
@aditya2000 try switchign airplane mode on/off
works fo me in most cases
Victor Popescu
@VicPopescu
Oct 31 2018 14:21
@aditya2000 `nmcli radio wifi off` and then `nmcli radio wifi on` and restart the computer says one guy
Oct 31 2018 14:21
Okay I'll try
Victor Popescu
@VicPopescu
Oct 31 2018 14:23
@aditya2000 and `rfkill list` too see your switches
and their status
Oct 31 2018 14:25
on *
glitz20
@glitz20
Oct 31 2018 14:27
hey guys I am updating multiple fields in mongoose
I have update function like this
``````  updateData(data, id) {
axios.post('/items/update/' + id, {
item: data
})
.then(res=> this.setState({ itemss: res.data }))
.catch(err => console.log(err))
}``````
and my form handle submit function like this
``````
handleSubmit(event) {
event.preventDefault();
this.props.history.push('/');
}``````
how should I handle input in the update function when I have multiple data/fields?
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:18
has `prop-types` been merged with `react`
`?
Christopher McCormack
@cmccormack
Oct 31 2018 16:18
@anandpotukchi other direction
it's been removed to its own package `prop-types`
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:19
what?
Christopher McCormack
@cmccormack
Oct 31 2018 16:19
it was a while ago
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:19
oh
Christopher McCormack
@cmccormack
Oct 31 2018 16:19
makes sense, you aren't required to use prop types and it can be easier to maintain as its own package
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:19
true
Christopher McCormack
@cmccormack
Oct 31 2018 16:20
The FCC challenges will be updated soon with this knowledge, right now they still show it bundled
@diomed
Oct 31 2018 16:48
Christopher McCormack
@cmccormack
Oct 31 2018 16:51
@diomed morning cat
@diomed
Oct 31 2018 16:52
@cmccormack top of the morning to you, sir. here is night already :yum:
Christopher McCormack
@cmccormack
Oct 31 2018 16:53
oh you're in opposite world I see
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:53
I just found out that hyderabad's population is more than that of Croatia @diomed
@diomed
Oct 31 2018 16:54
hyder what now?
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:54
the city which i live in
@diomed
Oct 31 2018 16:55
oh, that's normal for India
must be crowded for you guys
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:55
yeah. is. we fit in
that sucks
@diomed
Oct 31 2018 16:56
come to Croatia. nice fresh air, lots of space, and little of people :D
tho sometimes when we're in tram, it feels like India
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:56
have you ever visited?
@diomed ?
@diomed
Oct 31 2018 16:58
no
Anand Potukuchi
@anandpotukchi
Oct 31 2018 16:59
you seem to know a bit?
@diomed
Oct 31 2018 17:00
a bit of what?
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:00
India
@diomed
Oct 31 2018 17:00
it's wide known fact that India's crowded
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:01
nah. just parts
@diomed
Oct 31 2018 17:01
there's literally billion of you people
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:01
yeah we have enough land too
@diomed
Oct 31 2018 17:02
you took that from England, didn't you?
Christopher McCormack
@cmccormack
Oct 31 2018 17:02
lol
@diomed
Oct 31 2018 17:02
hue hue hue :smiling_imp:
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:03
and unlike china who's development is limited io Beijing, guangdong, Shanghai and Hong Kong, India is spread evenly
well England snatched it from us,we got it back
so how is croatia
as in the standard of living?
@diomed
Oct 31 2018 17:05
it's independent, thank you very much.
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:05
lol
@diomed
Oct 31 2018 17:05
latest news I heard about India is - some farmers are unhappy
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:06
one day I'm going to find you and make you pay
@diomed
Oct 31 2018 17:06
and wont let the fast train to be build
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:06
everyne is india is unhappy
@diomed
Oct 31 2018 17:06
except politicians
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:06
Like the rest of the world
yeah.....they're pretty happy
@diomed
Oct 31 2018 17:06
you got that right :/
@ezioda004
Oct 31 2018 17:09
:eyes:
Christopher McCormack
@cmccormack
Oct 31 2018 17:11
@ezioda004 morning! or whatever it is for you
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:11
It's night @cmccormack
10:40 PM
@ezioda004 :eyes:
I'm getting bored
@ezioda004
Oct 31 2018 17:12
@cmccormack @anandpotukchi Hey - hows it going?
Christopher McCormack
@cmccormack
Oct 31 2018 17:12
weird half hour timezones
I'm UTC -7
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:13
GMT and UTC, are they the same?
@ezioda004 im good. you?
Christopher McCormack
@cmccormack
Oct 31 2018 17:14
I think so
@ezioda004
Oct 31 2018 17:14
Not too shabby, one of the lazy days for me.
Christopher McCormack
@cmccormack
Oct 31 2018 17:14
so you would be UTC +17.5?
@anandpotukchi
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:15
@cmccormack 17.5?
as in 05:30?
yes
Christopher McCormack
@cmccormack
Oct 31 2018 17:16
oh oops `UTC+5:30 hours`
@ezioda004
Oct 31 2018 17:16
@diomed :cat: you resolved the earlier issue?
Christopher McCormack
@cmccormack
Oct 31 2018 17:16
not sure why I did 24 hours
@diomed
Oct 31 2018 17:17
I never resolve anything
hi @Manish-Giri I see you :cat:
Christopher McCormack
@cmccormack
Oct 31 2018 17:17
@ezioda004 good man ready to start adding React hooks into the cirriculum?
@ezioda004
Oct 31 2018 17:18
@cmccormack Shall we? :laughing:
Christopher McCormack
@cmccormack
Oct 31 2018 17:18
Yeah!
they seem great
Maybe enough to get @diomed to switch even!
@diomed
Oct 31 2018 17:18
what are hooks, in general?
@ezioda004
Oct 31 2018 17:18
My only issue is, its in alpha, who knows what they'd change
Christopher McCormack
@cmccormack
Oct 31 2018 17:18
@diomed
Oct 31 2018 17:18
what is their purpose, what do they do?
@ezioda004
Oct 31 2018 17:18
Christopher McCormack
@cmccormack
Oct 31 2018 17:19
lets you use state and other React features without writing a class
@ezioda004
Oct 31 2018 17:19
Couple of challenges and its essential for a React dev anyway
Christopher McCormack
@cmccormack
Oct 31 2018 17:19
@ezioda004 hmm it's just a package, do we have cirriculum for other packages?
oh yeah we do Redux
so yeah!
@diomed
Oct 31 2018 17:19
@cmccormack unsure of use of this
@ezioda004
Oct 31 2018 17:19
Yeah, I think adding Router would make most sense
Christopher McCormack
@cmccormack
Oct 31 2018 17:20
```
Code
```
you can update previous posts
@diomed
Oct 31 2018 17:20
btw. I saw something like that happening in vue commmunity too, but I'm still a vue :baby:
Christopher McCormack
@cmccormack
Oct 31 2018 17:21
oh yeah that looks very similar
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:22
@ezioda004 @cmccormack I personally prefer `react-navigation`
so there's no point in adding router, b'coz it;'s a personal preference
@ezioda004
Oct 31 2018 17:23
IIRC you can use react-router for native apps too
michel perez
@MichelPra
Oct 31 2018 17:23
``````shouldComponentUpdate(nextProps, nextState) {
console.log('Should I update?');
// change code below this line
if (nextProps.value % 2 == 0) {
return true;
}``````
i can replace `if (nextProps.value % 2 == 0) {return true;}`
by `return {nextProps.value % 2 == 0}`
??????
Christopher McCormack
@cmccormack
Oct 31 2018 17:23
Redux is in the cirriculum and it is also a personal preference
@ezioda004
Oct 31 2018 17:23
Its also backed by facebook themselves so it makes sense
Christopher McCormack
@cmccormack
Oct 31 2018 17:24
which redux or react router?
I met Michael Jackson a few months ago, nice guy
@ezioda004
Oct 31 2018 17:24
Router
Eating too many special brownies?
Christopher McCormack
@cmccormack
Oct 31 2018 17:24
He's taking input for the next version of React Router if anyone is interested
@ezioda004
Oct 31 2018 17:25
Lol, now I'm trippin
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:25
the guy from react-training
?
Christopher McCormack
@cmccormack
Oct 31 2018 17:25
I'm hoping to meet Ryan Florence next week, he's talking at a meetup in Phoenix Monday and then my company is hosting training by him Tues and Wednesday at my office
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:26
nice
@ezioda004
Oct 31 2018 17:26
@cmccormack Oh yeah hes awesome, in our scholarship course, we were taught react-router by him
Christopher McCormack
@cmccormack
Oct 31 2018 17:26
yeah tickets are almost \$1k but my work is raffling off 5 free ones
hoping to win
@ezioda004 what a way to learn it!
he's the reason I want to learn VIM as well
he's like a wizard
@diomed
Oct 31 2018 17:27
wow, nothing crashes my firefox as codesandbox does
Christopher McCormack
@cmccormack
Oct 31 2018 17:27
I dont' watch many videos but I've watched this one a few times
@ezioda004
Oct 31 2018 17:27
@10vivar You dont need `{ }` in `return {nextProps.value % 2 == 0}`
@cmccormack That looks interesting, will checkout. I really like watching conf videos
Recently watched the npm talk, it was quite entertaining
Christopher McCormack
@cmccormack
Oct 31 2018 17:30
@ezioda004 he helped me better understand HoC and render props in that video
@ezioda004
Oct 31 2018 17:31
We need a hook video from him :D
Christopher McCormack
@cmccormack
Oct 31 2018 17:31
I bet he has them, he does React training
michel perez
@MichelPra
Oct 31 2018 17:31
@ezioda004 so `return nextProps.value % 2 == 0;` it's more concise and better?
Christopher McCormack
@cmccormack
Oct 31 2018 17:31
all of these guys do now
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:31
16.6?
were hooks discussed?
Christopher McCormack
@cmccormack
Oct 31 2018 17:32
doesn't look like hooks but it does have suspense
@ezioda004
Oct 31 2018 17:34
@10vivar Yes, we dont really return `true` or `false` from `if..else` statements
Anand Potukuchi
@anandpotukchi
Oct 31 2018 17:39
@cmccormack suspense isn't stable yet right?
ok folks. gotta go. go
good night
Christopher McCormack
@cmccormack
Oct 31 2018 17:39
don't think so
night!
Jason Luboff
@JLuboff
Oct 31 2018 17:39
@ezioda004 Psh...maybe you don't :P
Tommy Bogdanovich
@Tommyisr
Oct 31 2018 18:56
Is it a normal practice to use some grids on the one page ?