These are chat archives for FreeCodeCamp/Help

1st
Oct 2018
Manan Shah
@mananshah51
Oct 01 2018 03:28

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/compare-scopes-of-the-var-and-let-keywords

Can someone help me with this following Lesson. I am unable to figure out why the value of printNumTwo comes to be 3 instead of 2.

Claudio Restifo
@Marmiz
Oct 01 2018 03:40
@mananshah51 cos the 3rd statement of the loop gets evaluated:
i = 0 ;  is i < 3 (YES); then i = 1;
i = 1 ;  is i < 3 (YES); then i = 2;
i = 2;  is i < 3 (YES); then i = 3;

i = 3;  is i < 3 (NO); stop execution.
that's in "word" how a for loop gets evaluated
Manan Shah
@mananshah51
Oct 01 2018 03:42
@Marmiz I get this part, but i want to know more about this statement ```printNumTwo = function() {
return i;
};
````
printNumTwo = function() {
      return i;
    };
When this bunch of lines are executed, why do they print 3 instead of 2. @Marmiz
Claudio Restifo
@Marmiz
Oct 01 2018 03:44
@mananshah51 complete code? there are bunch of example in the page :)
@Marmiz Above is the link to the page.
Claudio Restifo
@Marmiz
Oct 01 2018 03:45
@mananshah51 again. Which one are you referring. There are like 5 different examples :)
(4 caoont count)
Manan Shah
@mananshah51
Oct 01 2018 03:46
I am referring to the 3rd example
Claudio Restifo
@Marmiz
Oct 01 2018 03:47
@mananshah51 oh that's because by the time the function gets called the global variable i is updated from 2 to 3 :)
Manan Shah
@mananshah51
Oct 01 2018 03:48
@Marmiz Okay Okay I get it. Thank you so much for your help. I appreciate it.
Claudio Restifo
@Marmiz
Oct 01 2018 03:48
by using let in the last example you are instructing your program to use the value of the variable it has in its scope.
which at that time was 2
the takeaway here is : "global variables are bad"
Manan Shah
@mananshah51
Oct 01 2018 03:51
@Marmiz Ohh Okay I get it now. Thank you so much for your help.
Claudio Restifo
@Marmiz
Oct 01 2018 04:01
:+1:
Johnny Cruz
@croozayy_twitter
Oct 01 2018 06:03
Hey
My bad for not
Johnny Cruz
@croozayy_twitter
Oct 01 2018 06:10
Gutted doesnโ€™t work well on phone. If anyone wants Dre courses from css grid to js for intermediate learners I highly recommend. Tia site
BuntyBru
@BuntyBru
Oct 01 2018 06:10
I am installing Ubuntu 18.04 into my laptop, and i am getting this
Please remove the installation medium , then reboot
I have removed the pendrive but still its stuck at that
Steevensm
@Steevensm
Oct 01 2018 06:14
How to serve asset files from the /public directory?
Aditya
@ezioda004
Oct 01 2018 06:22
@Steevensm Are you using express?
BuntyBru
@BuntyBru
Oct 01 2018 06:34
I have been installing Ubuntu for a while
Everytime there is some delay due to some reason or other
williambradley
@william13189205_twitter
Oct 01 2018 09:20
I would like to recommend this https://tinyurl.com/yd7tkhp8
BuntyBru
@BuntyBru
Oct 01 2018 09:47
Whats this
Hubert Kubasiewicz
@hubkubas
Oct 01 2018 10:45
Dear friends one of the tasks is product landing page. Is it ok of i make service landing page instead?
petrockwd
@petrockwd
Oct 01 2018 11:14
@hubkubas Yeah man it's your learning I wouldn't see why not
Hubert Kubasiewicz
@hubkubas
Oct 01 2018 11:22
Well I Just want it to be clear thx for your answer :smile:
Henry
@GitHub-Henry
Oct 01 2018 11:27
product/service technically doesn't matter what you do. but perhaps learning to code to requirements does
i know a company that lost a multi BILLION dollar contract, because a manager thought he didn't have to meet the stated requirements for a contract, so perhaps learning to meet requirements does matter
petrockwd
@petrockwd
Oct 01 2018 11:37
Lol Henry. I don't think that applies here
with a billion dollar deal not meeting the stated requirements is just stupidity
Henry
@GitHub-Henry
Oct 01 2018 11:41
learning to meet requirements, is something schools require. you can't turn in anything you want when an assignment is made and tell the teacher, "this isn't what you asked for, but this is close enough." isn't fcc a kind of school
petrockwd
@petrockwd
Oct 01 2018 11:44
I wouldn't say so lol -> it's self taught education. You get out of it what you want
Anyone completed the Javascript Regular expressions modules/
?
I'm stuck on "Regular expressions: match characters that occur zero or more times"
Henry
@GitHub-Henry
Oct 01 2018 11:46
this helped me https://regex101.com/
petrockwd
@petrockwd
Oct 01 2018 11:49
Thanks Hengry
Henry
I'm still stuck
Henry
@GitHub-Henry
Oct 01 2018 11:49
@petrockwd btw, when you claim a certificate fcc says about itself, As an academic institution that grants achievement-based certifications, fcc regards itself as a type of school
petrockwd
@petrockwd
Oct 01 2018 11:50
@GitHub-Henry No point arguing mate. We're just going to have to disagree on this one
@GitHub-Henry Think you can help me with this regex?
Henry
@GitHub-Henry
Oct 01 2018 11:51
did you read the helps available at regex101.com? go through the site, it has LOTS of stuff that will help with regex
run some tests learn by doing
it really is a good site
petrockwd
@petrockwd
Oct 01 2018 11:53
@GitHub-Henry Okay thanks :-)
@GitHub-Henry ++
Oh wow that site is great
once I figured out how to use ha ha ha
Aditya
@ezioda004
Oct 01 2018 12:08
@petrockwd Whats your regex so far?
petrockwd
@petrockwd
Oct 01 2018 12:11
@ezioda004 Just finishing up those challenges :-)
Aditya
@ezioda004
Oct 01 2018 12:12
Nice, I thought you were still stuck
petrockwd
@petrockwd
Oct 01 2018 12:15
@ezioda004 Thanks for the offer to help, though.
petrockwd
@petrockwd
Oct 01 2018 12:24
I am stuck on the 2nd to last regex problem
snakecase
@snakecase
Oct 01 2018 12:27
Hey there. Where should I report small typos and output errors which FCC's debugger gives?
May Kittens Devour Your Soul
@diomed
Oct 01 2018 12:40
@snakecase prolly on FCC's official github repo
@ezioda004 but what do you read?
snakecase
@snakecase
Oct 01 2018 12:45
@diomed got it, thanks. Though it was too much to open an issue for every slightest typo but seems it's ok.
Aditya
@ezioda004
Oct 01 2018 12:53
@diomed What do you mean?
Henry
@GitHub-Henry
Oct 01 2018 12:55
perhaps cat's have a limited vocabulistics, prolly larger than, 'I am Groot', but not much larger
May Kittens Devour Your Soul
@diomed
Oct 01 2018 12:55
@ezioda004 like, do you read belletristic?
got a favorite book that is not about JS? :smile:
Aditya
@ezioda004
Oct 01 2018 12:58
@diomed Not a literature person, I've read like only couple of novels of which I liked ASOIAF
Henry
@GitHub-Henry
Oct 01 2018 13:00
did you read all the GOT books
May Kittens Devour Your Soul
@diomed
Oct 01 2018 13:01
sometimes I forget there are books
ha! that guy gets away so easy. other people are gonna write closure for his books
Aditya
@ezioda004
Oct 01 2018 13:01
No, first two only
@diomed You done with the PRs?
May Kittens Devour Your Soul
@diomed
Oct 01 2018 13:02
with what now?
Aditya
@ezioda004
Oct 01 2018 13:02
PR's for hacktoberfest
May Kittens Devour Your Soul
@diomed
Oct 01 2018 13:02
O_o
ummmm...
Henry
@GitHub-Henry
Oct 01 2018 13:06
i'm guessing bran is gonna go into the past and do something, anything to change history so the present won't end up the way it does. remember bran was able to call out to his dad, so perhaps he can go back into time and do something that will help those in the present. so goes my guess for season 8. all this talk about bran has a special part to play, but the only thing he can do is with his mind.
May Kittens Devour Your Soul
@diomed
Oct 01 2018 13:07
am watching GOT on TV week by week, wondering will that boy run cik-cak this time?
zig-zag
Aditya
@ezioda004
Oct 01 2018 13:09
Idk if he can manipulate the timelines
Daniel Simeonov
@dbsimeonov
Oct 01 2018 13:12
v-on:click="$router.go( ${history} )" Can anyone help me with the syntax on this one, I want to get the history from a data object
Henry
@GitHub-Henry
Oct 01 2018 13:13
these are times of desperation, i don't think bran knows if can actually do anything, perhaps he can't but the world as he knows it is in great need, so perhaps he's willing to try to do anything that will help. didn't bran go back into the past and warg into hodor, that was a confusing episode, so i wasn't really sure what was going on there. but what if bran goes into the past and wargs into another person, just guesses and theories
the guesses are based on, bran has a part to play in the up coming war. as far as we know bran has two skills, traveling time and warging into animals and people, so that's why i guess he goes back in time and wargs into a person.
Henry
@GitHub-Henry
Oct 01 2018 13:18
and if you are going to warg into any one person who would that be, the leader of the wight walkers
the leader of wight walkers has already proven his magic is stronger than bran's, so what if bran can't warg out
Aditya
@ezioda004
Oct 01 2018 13:27
Oh yeah he actually was responsible for hodor
Henry
@GitHub-Henry
Oct 01 2018 13:29
if bran goes in to the past and wargs into the wight walker king, and the kings magic is stronger then bran could get trapped in the past.
his body in the present and his mind in the past
remember when bran was in the wolf, bran said he tasted the blood of the hunt, so a connection is made between bran and the wolf
so if bran warged into the king, there would be a connection between bran and the king
so if you kill bran, while he is warged into the king, would you kill the wight walker king
Henry
@GitHub-Henry
Oct 01 2018 13:34
what if jon had to kill bran
all guesses and theories
petrockwd
@petrockwd
Oct 01 2018 13:49
could anyone help me with the second to last regex problem?
May Kittens Devour Your Soul
@diomed
Oct 01 2018 13:50
yes, just post question here, and someone will help you
petrockwd
@petrockwd
Oct 01 2018 13:51
let huhText = "This sandwich is good.";
let fixRegex = /change/; // Change this line
let replaceText = ""; // Change this line
let result = huhText.replace(fixRegex, replaceText);
Write a regex so that it will search for the string "good". Then update the replaceText variable to replace "good" with "okey-dokey".
That's the challenge
Aditya
@ezioda004
Oct 01 2018 13:53
@petrockwd Change fixRegex so it matches goodand replaceText to okey-dokey
petrockwd
@petrockwd
Oct 01 2018 13:54
@ezioda004 Yeah that's the challenge
Henry
@GitHub-Henry
Oct 01 2018 13:54
it's worth a read
Aditya
@ezioda004
Oct 01 2018 13:55
@petrockwd Anything specific that you're not getting?
petrockwd
@petrockwd
Oct 01 2018 13:56
I can't get the regex code needed
Aditya
@ezioda004
Oct 01 2018 13:58
You need to match good, so regex is simply /good/
petrockwd
@petrockwd
Oct 01 2018 14:00
oh it's that easy??
lol
rofl...feeling dumb
Aditya
@ezioda004
Oct 01 2018 14:01
:smile:
May Kittens Devour Your Soul
@diomed
Oct 01 2018 14:02
they oversimplify it so we dont understand the question
that's how they get you
Aditya
@ezioda004
Oct 01 2018 14:04
๐Ÿ˜ˆ
petrockwd
@petrockwd
Oct 01 2018 14:05
lol thanks everyone...I spent wayyyyyyyy too long on that
May Kittens Devour Your Soul
@diomed
Oct 01 2018 14:45
can't believe my little kitten was on last plase again, in speling bee competition :-/
Karma Drukpa
@coderkarma
Oct 01 2018 14:50
Hello ๐Ÿ‘‹
Henry
@GitHub-Henry
Oct 01 2018 15:08
:wave:
Nicolas Ramirez
@kamatheuska
Oct 01 2018 16:19
@dbsimeonov I now some Vue, maybe you could give more context?
May Kittens Devour Your Soul
@diomed
Oct 01 2018 16:21
@kamatheuska pls adopt me, and be my mento
vue mento
Daniel Simeonov
@dbsimeonov
Oct 01 2018 17:31
@kamatheuska I've sorted it, stupid function took me all day at work to do... Thanks anyway
Kyle Holm
@thekholm80
Oct 01 2018 18:56
happy monday, /help
Aditya
@ezioda004
Oct 01 2018 19:01
Bonjour :wavy_dash:
May Kittens Devour Your Soul
@diomed
Oct 01 2018 19:45
:moustache:
Nicolas Ramirez
@kamatheuska
Oct 01 2018 20:25
@diomed lol, sure, i can call you young padwan if you like
Gianpaolo
@gianpaolodatu
Oct 01 2018 23:54
Screenshot from 2018-10-02 01-32-37.png

To test what was written, I made an object in chrome's console. this is the code I wrote:
var obj = {
"nospace": "test",
};

When I tried to output the value of nospace in the console with:
console.log(obj[nospace]);

It gave me this error:
"Uncaught ReferenceError: nospace is not defined
at <anonymous>:1:17"

Is there a mistake in the text, or am I doing something wrong? please help

Karma Drukpa
@coderkarma
Oct 01 2018 23:57
@gianpaolodatu you need to do console.log(obj['nospace']);
you missing quotes
Gianpaolo
@gianpaolodatu
Oct 01 2018 23:58
alright, but in the text it's written like you need quotes only if there's space in the property's name