These are chat archives for FreeCodeCamp/Help

12th
Sep 2017
Nick Cleary
@Hijerboa
Sep 12 2017 00:00
like this?
function steamrollArray(arr){
  var finalArray = arr.reduce(function(a,b){
    if(Array.isArray(b)){
      b = b[0];
    }
    return [a,b];
  }, []);
just1witness
@just1witness
Sep 12 2017 00:00
Getting there!
Nick Cleary
@Hijerboa
Sep 12 2017 00:01
close... but so far :(
just1witness
@just1witness
Sep 12 2017 00:02
so when your b returns true in the if statement, you want to concat it with a, but with recursion a.concat(steamrollArray(b))
then after that's all done you want to concat a with b
@Hijerboa
Nick Cleary
@Hijerboa
Sep 12 2017 00:06
@just1witness This returns a whole bunch of arrays. For some reason it seems to not have worked out "flattening" the arrays at all.
function steamrollArray(arr){
  var finalArray = arr.reduce(function(a,b){
    if(Array.isArray(b)){
      a.concat(steamrollArray(b))
    }
    return [a,b];
  }, []);
  console.log(finalArray);
  return finalArray;
}
korzo
@korzo
Sep 12 2017 00:06
@Hijerboa return is wrong
you have to merge a with b and return it
Nick Cleary
@Hijerboa
Sep 12 2017 00:07
soooo..... return a.concat(steamrollArray(b))?
korzo
@korzo
Sep 12 2017 00:07
@Hijerboa also a.concat(steamrollArray(b)) you need to assign this to something
just1witness
@just1witness
Sep 12 2017 00:07
Your last return isn't concatenated
It needs to be
wnghero
@wnghero
Sep 12 2017 00:07
can someone test my site for me, you arent suppose to be able to make multiple accounts on the same ip and it's not working when i try to but i see accounts from the same ip
just1witness
@just1witness
Sep 12 2017 00:08
yes, what @korzo said, return would do
Nick Cleary
@Hijerboa
Sep 12 2017 00:08
@just1witness the return after the console.log?
korzo
@korzo
Sep 12 2017 00:08
@Hijerboa yes
@Hijerboa also you need to handle case, when b is not an array
but you are very close now
Nick Cleary
@Hijerboa
Sep 12 2017 00:09
but a and b aren't defined outside of the function
lol I feel like this is just circular logic
korzo
@korzo
Sep 12 2017 00:11
@Hijerboa you have 3 errors in you last code
  1. assign back a.concat(steamrollArray(b))
  2. handle else case
  3. fix return value
just1witness
@just1witness
Sep 12 2017 00:11
They are defined, you declare them @ ARR.reduce
a = result of whatever statement you define in the function, b = the current value being processed
@Hijerboa
Nick Cleary
@Hijerboa
Sep 12 2017 00:14
heres my current try:
function steamrollArray(arr){
  var finalArray = arr.reduce(function(a,b){
    if(Array.isArray(b)){
      a.concat(steamrollArray(b))
    }else{
      a.concat(b);
    }
    return [a,b];
  }, []);
  console.log(finalArray);
  return a.concat(steamrollArray(b));
}
unsurprisingly, it doesn't work so well
just1witness
@just1witness
Sep 12 2017 00:14
You shouldn't have return a,b
korzo
@korzo
Sep 12 2017 00:14
@Hijerboa a.concat(b) does nothing
just1witness
@just1witness
Sep 12 2017 00:14
you can get rid of that entirely
and yes ^
korzo
@korzo
Sep 12 2017 00:14
You have to assign it back a = a.concat(b)
just1witness
@just1witness
Sep 12 2017 00:14
you need to return that
or what @korzo said, either way
Gersho
@Gersho
Sep 12 2017 00:15
you have to make a difference between a function that does stuff but returns nothing, and a function that returns something
Nick Cleary
@Hijerboa
Sep 12 2017 00:16
like this?
function steamrollArray(arr){
  var finalArray = arr.reduce(function(a,b){
    if(Array.isArray(b)){
      return a.concat(steamrollArray(b))
    }else{
      return a.concat(b);
    }
  }, []);
  console.log(finalArray);
  return a.concat(steamrollArray(b));
}
korzo
@korzo
Sep 12 2017 00:16
@Hijerboa yes
just1witness
@just1witness
Sep 12 2017 00:17
get rid of the last return and it should pass now
@Hijerboa
Nick Cleary
@Hijerboa
Sep 12 2017 00:18
@just1witness @korzo IT WORKS
Gersho
@Gersho
Sep 12 2017 00:18
\o/
Nick Cleary
@Hijerboa
Sep 12 2017 00:18
I WANT TO HUG YOU GUYS
YOU'RE AMAZING
just1witness
@just1witness
Sep 12 2017 00:18
yippy! :)
Nick Cleary
@Hijerboa
Sep 12 2017 00:18
<3
@Gersho and you too mate
thanks all! @just1witness @Gersho @korzo
CamperBot
@camperbot
Sep 12 2017 00:18
hijerboa sends brownie points to @just1witness and @gersho and @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 414 | @gersho |http://www.freecodecamp.com/gersho
api offline
:cookie: 475 | @korzo |http://www.freecodecamp.com/korzo
Nick Cleary
@Hijerboa
Sep 12 2017 00:18
@just1witness thanks because "api offline"
CamperBot
@camperbot
Sep 12 2017 00:18
hijerboa sends brownie points to @just1witness :sparkles: :thumbsup: :sparkles:
api offline
Gersho
@Gersho
Sep 12 2017 00:18
lol camperbot doesn't like @just1witness
Nick Cleary
@Hijerboa
Sep 12 2017 00:18
welp
just1witness
@just1witness
Sep 12 2017 00:18
Nope, it hates me
lol
Nick Cleary
@Hijerboa
Sep 12 2017 00:19
I'll just have to send you brownies irl
just1witness
@just1witness
Sep 12 2017 00:19
yumm!
Gersho
@Gersho
Sep 12 2017 00:19
someone must have told him you have diabetes or something
just1witness
@just1witness
Sep 12 2017 00:19
haha
I don't think so, I never eat sugar and weigh 115 after 4 kids, no diabetes here! ;P
buuuut I never eat sugar soooo, no brownies for me, lol
Nick Cleary
@Hijerboa
Sep 12 2017 00:20
function steamrollArray(arr){
  var finalArray = arr.reduce(function(a,b){      //calls first two items in the array
    if(Array.isArray(b)){ //if the second is an array
      return a.concat(steamrollArray(b)) //flatten it, recall function
    }else{
      return a.concat(b); //push them together
    }
  }, []);
  console.log(finalArray);
  return finalArray;
}
Just checking: am I understanding this right?
just1witness
@just1witness
Sep 12 2017 00:21
a is an accumulator, it is 0 the first time the recursion runs
if b returns true, it's pushed to a
Gersho
@Gersho
Sep 12 2017 00:21

I don't think so, I never eat sugar and weigh 115 after 4 kids, no diabetes here! ;P

just in case, i'll be asking what unit we are talking about :P

korzo
@korzo
Sep 12 2017 00:21

@Hijerboa this is not actually true, if you pass [] as last argument

//calls first two items in the array

just1witness
@just1witness
Sep 12 2017 00:21
lbs
man I would be as big as a house the other way, haha
Gersho
@Gersho
Sep 12 2017 00:22
well you'd be if you were 115kg
Nick Cleary
@Hijerboa
Sep 12 2017 00:22
oh so basically if b is an array, it pushes it to a, then concats it?
just1witness
@just1witness
Sep 12 2017 00:22
lol
korzo
@korzo
Sep 12 2017 00:22
@just1witness I was affraid to ask this :)
Nick Cleary
@Hijerboa
Sep 12 2017 00:22
lmao
just1witness
@just1witness
Sep 12 2017 00:22
No I'm tiny, I wear size zero in pants... (I wonder if pant sizes are different for you too)
Long Nguyen
@longnt80
Sep 12 2017 00:22
@Hijerboa just concat
Gersho
@Gersho
Sep 12 2017 00:23
@just1witness each country has different size for every clothing item (yeah we agreed on meters, but not for our butts)
korzo
@korzo
Sep 12 2017 00:23
@Hijerboa if in doubts, open your console and try it
Nick Cleary
@Hijerboa
Sep 12 2017 00:24
@longnt80 ok... so if b is an array, it concats it, then recalls the function and repeats the process?
just1witness
@just1witness
Sep 12 2017 00:24
LOL. I like other dating systems but not measuring systems, other than having whole integers more often, I don't get why the units are bigger. It seems less precise to me.
@Hijerboa
yes
korzo
@korzo
Sep 12 2017 00:24
@Hijerboa it recall the function and concat the result
Nick Cleary
@Hijerboa
Sep 12 2017 00:25
i think I get it now. Thanks guys! @korzo @just1witness @longnt80
CamperBot
@camperbot
Sep 12 2017 00:25
hijerboa sends brownie points to @korzo and @just1witness and @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 550 | @longnt80 |http://www.freecodecamp.com/longnt80
api offline
api offline
Nick Cleary
@Hijerboa
Sep 12 2017 00:26
i think api offline means that I already sent someone points
just1witness
@just1witness
Sep 12 2017 00:26
Well, I don't like you either cbot...
Nick Cleary
@Hijerboa
Sep 12 2017 00:26
@longnt80 thanks mate (testing)
CamperBot
@camperbot
Sep 12 2017 00:26
hijerboa sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
api offline
Nick Cleary
@Hijerboa
Sep 12 2017 00:26
yep
thats prob what it is
just1witness
@just1witness
Sep 12 2017 00:26
find cbots awesomeness
CamperBot
@camperbot
Sep 12 2017 00:26
find cbots awesomeness
nothing found
just1witness
@just1witness
Sep 12 2017 00:26
LOL
korzo
@korzo
Sep 12 2017 00:26
:) :) :)
Nick Cleary
@Hijerboa
Sep 12 2017 00:26
find a guide to having programming make sense
CamperBot
@camperbot
Sep 12 2017 00:26
find a guide to having programming make sense
nothing found
Gersho
@Gersho
Sep 12 2017 00:27
find my soulmate
CamperBot
@camperbot
Sep 12 2017 00:27
find my soulmate
nothing found
just1witness
@just1witness
Sep 12 2017 00:27
sorry dude
Gersho
@Gersho
Sep 12 2017 00:27
...
just1witness
@just1witness
Sep 12 2017 00:27
Awww :(
Nick Cleary
@Hijerboa
Sep 12 2017 00:27
this got dark fast
Gersho
@Gersho
Sep 12 2017 00:27
D:
Nick Cleary
@Hijerboa
Sep 12 2017 00:28
find someone who doesn't love @Gersho
CamperBot
@camperbot
Sep 12 2017 00:28
find someone who doesnt love @gersho
nothing found
Nick Cleary
@Hijerboa
Sep 12 2017 00:28
see? It'll be ok
Gersho
@Gersho
Sep 12 2017 00:28
^^
just1witness
@just1witness
Sep 12 2017 00:28
Awwwwwww <3
Nick Cleary
@Hijerboa
Sep 12 2017 00:28
@Gersho wierd question: what did you use to create your avatar?
Gersho
@Gersho
Sep 12 2017 00:29
it never finds anything, of course it's a stockpile of dark jokes :P
it's a screenshot from a cartoon
Nick Cleary
@Hijerboa
Sep 12 2017 00:29
oh welp
Gersho
@Gersho
Sep 12 2017 00:30
Daria, it's about a sarcastic girl in HS
CamperBot
@camperbot
Sep 12 2017 00:31
you called?
piteto
@piteto
Sep 12 2017 00:32
@camperbot holler
CamperBot
@camperbot
Sep 12 2017 00:32
holler back!
just1witness
@just1witness
Sep 12 2017 00:32
@camperbot is a biased jerk
lol
Gersho
@Gersho
Sep 12 2017 00:32
maybe he's sexist
just1witness
@just1witness
Sep 12 2017 00:33
shame
oh, the shame
piteto
@piteto
Sep 12 2017 00:33
I luv u cbot
CamperBot
@camperbot
Sep 12 2017 00:33
@piteto, :sparkles: :heart_eyes: :sparkles:
piteto
@piteto
Sep 12 2017 00:33
lol
Steven Cunningham
@scunningham09
Sep 12 2017 00:33
Has anyone watched all the free code camp videos on YouTube?
piteto
@piteto
Sep 12 2017 00:34
I didn't know there were videos
Gersho
@Gersho
Sep 12 2017 00:34
i have watched 0, not even the ones on the challenge pages
Nick Cleary
@Hijerboa
Sep 12 2017 00:34
Albert Cardona II
@daddycardona
Sep 12 2017 00:35
Nope but can someone explain .reduce() to me better than I am understanding?
piteto
@piteto
Sep 12 2017 00:35
I'll get through this front end stuff and check it out hopefully some videos on react, d3, and node
Gersho
@Gersho
Sep 12 2017 00:36
i remember watching some nice videos from "eli the computer guy" but they were more about employability than actual coding
Long Nguyen
@longnt80
Sep 12 2017 00:36
@daddycardona how are you understanding .reduce?
korzo
@korzo
Sep 12 2017 00:37
@daddycardona You get 2 arguments.
  1. is final value
  2. is current element.
    what you return will be 1. argument at next call
Albert Cardona II
@daddycardona
Sep 12 2017 00:37
Okay let me put some code up and then I can understand it better that way :)
Long Nguyen
@longnt80
Sep 12 2017 00:38
actually, .reduce take 4 arguments
Albert Cardona II
@daddycardona
Sep 12 2017 00:38
function uniteUnique(arr, arr2, arr3) {


    var reducer = arr.reduce(function(e, i) {
        if (e !== i) {
            return e;
        }

    }, []);

    console.log(reducer)

    return arr;
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
so e is the first
Steven Cunningham
@scunningham09
Sep 12 2017 00:39
That’s the channel with the videos I’m referring to
korzo
@korzo
Sep 12 2017 00:39
@daddycardona You return nothing if e == i
Albert Cardona II
@daddycardona
Sep 12 2017 00:39
shoot I meant to take out the ,[]
e!==i
So if I take out the [] then that means e should be the first element and i the 2nd element?
korzo
@korzo
Sep 12 2017 00:40
@daddycardona yes
Gersho
@Gersho
Sep 12 2017 00:40
wouldn't that make the code crash is the first argument (arr) isn't an array ?
korzo
@korzo
Sep 12 2017 00:41
@Gersho reduce is not a function I suppose
Albert Cardona II
@daddycardona
Sep 12 2017 00:41
so technically I should be seeing reducer=== [1,3,2]?
Or I should be seeing the outcome of return e // as that
Okay how would i change that because I just keep getting 1
korzo
@korzo
Sep 12 2017 00:44
@daddycardona you have to push e in array
@daddycardona At first itteration e is [] and i is 1
Gersho
@Gersho
Sep 12 2017 00:46

Okay how would i change that because I just keep getting 1

in the console.log(reducer) or the return of the function ?

Albert Cardona II
@daddycardona
Sep 12 2017 00:46
so the variable reducer gets what if all i had was return e in the function?
or would i have to be like return reducer.push(e)?
korzo
@korzo
Sep 12 2017 00:48
@daddycardona reducer will be e after the last call
@daddycardona Or better what you return from the last call
Albert Cardona II
@daddycardona
Sep 12 2017 00:49
that is weird because if I return e i get 1 but return i is 2 when I log reducer
korzo
@korzo
Sep 12 2017 00:51
@moigithub its reduce
Moisés Man
@moigithub
Sep 12 2017 00:52
ah
korzo
@korzo
Sep 12 2017 00:52
@daddycardona log e and i at the start of the function to see it
Gersho
@Gersho
Sep 12 2017 00:53
you should put some string to it too since you're gonna get results with each itteration
Albert Cardona II
@daddycardona
Sep 12 2017 00:55
Okay this is what i see
 var reducer = arr.reduce(function(e, i) {
        reduncedIt.push(i)
        console.log('the e: ' + e)
        console.log('the i: ' + i)
        return i;


    });
    //console.log(reduncedIt)
    //console.log(reducer)

    return arr;
}
with this code
blob
I just don't understand how come e don't itterate all the way through too 2
Moisés Man
@moigithub
Sep 12 2017 00:57
whatever u return will be the next value for e
korzo
@korzo
Sep 12 2017 00:57
@daddycardona because you return i
It means that in the next call, e will be i from previous call
Albert Cardona II
@daddycardona
Sep 12 2017 00:58
if I return e i only get 1 sometimes 1 and 3 like you see it here
the e: 1
main.js:7 the i: 3
main.js:6 the e: 1
main.js:7 the i: 2
main.js:13 the reducer variable: 1
Moisés Man
@moigithub
Sep 12 2017 01:01

whatever u return will be the next value for e

soo if u return e.. and e is 1..
what would be the next value of e ??

korzo
@korzo
Sep 12 2017 01:01

@daddycardona

[1, 2, 3, 4, 5].reduce(function(a, e) {
    console.log('e is ' + e);
    console.log('a is ' + a);
    console.log('----------------');
    return a + e;
}, 0);

"e is 1"
"a is 0"
"----------------"
"e is 2"
"a is 1"
"----------------"
"e is 3"
"a is 3"
"----------------"
"e is 4"
"a is 6"
"----------------"
"e is 5"
"a is 10"
"----------------"

Albert Cardona II
@daddycardona
Sep 12 2017 01:01
should be 3?
Moisés Man
@moigithub
Sep 12 2017 01:01
NO
cuz e is 1

```
the e: 1 // <<<<<<<<<<
main.js:7 the i: 3
main.js:6 the e: 1 ///<<<<<<<<
main.js:7 the i: 2
main.js:13 the reducer variable: 1

```

Albert Cardona II
@daddycardona
Sep 12 2017 01:03
why is it 1 I didn't use ,0) to close it and it should be 3 if it iterates properly
Moisés Man
@moigithub
Sep 12 2017 01:03
whatever u return will be the next value for e
Albert Cardona II
@daddycardona
Sep 12 2017 01:06
The problem is when I read the documentation it says that if you don't use },o||{}\\[]); then e is the previous or first element in the array am I correct?
Moisés Man
@moigithub
Sep 12 2017 01:07
without 2nd param
if have [1,2,3]
e,i e will be 1, i will be 2 (on first iteration)
but still..
whatever u return will be the next value for e
[1,2,3,4].reduce( (e,i) => {
   console.log(e);
     return 9;
})
it will log 1
then 9's
Albert Cardona II
@daddycardona
Sep 12 2017 01:10
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce?v=b
if you scroll down to how it works it basically says that where I put e is 1 each call? am I not completing a call or somethign
Okay @moigithub I see what you are saying, I just added an return9 and it returned number 9 the second time so would I need to add like return i instead?
korzo
@korzo
Sep 12 2017 01:16
@daddycardona then result will be last element of array
Albert Cardona II
@daddycardona
Sep 12 2017 01:17
well then do i push I to an array?
korzo
@korzo
Sep 12 2017 01:18
If you push i in array e, then result will be the same array as at the start
Albert Cardona II
@daddycardona
Sep 12 2017 01:19
so I need to make an array that gets all 3 arrays then reduce that one big array i guess is what the challenge is askign for
korzo
@korzo
Sep 12 2017 01:20
@daddycardona Yes
Albert Cardona II
@daddycardona
Sep 12 2017 01:20
and I will be back trying to figure that out lol
korzo
@korzo
Sep 12 2017 01:20
I think filter method is more suitable for this challenge, but it's doable also with reduce
Gersho
@Gersho
Sep 12 2017 01:20
if you do it like you said, how will you be able to tell the arrays apart ?
Moisés Man
@moigithub
Sep 12 2017 01:21
or just a loop
korzo
@korzo
Sep 12 2017 01:21

@Gersho I think it's this challenge:

Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.

Albert Cardona II
@daddycardona
Sep 12 2017 01:22

Sorted Union
Write a function that takes two or more arrays and returns a new array of unique values in the order of the original provided arrays.

In other words, all values present from all arrays should be included in their original order, but with no duplicates in the final array.

The unique numbers should be sorted by their original order, but the final array should not be sorted in numerical order.

Check the assertion tests for examples.

@Gersho and @korzo you're right you just won a trip to florida
Gersho
@Gersho
Sep 12 2017 01:22
...great place to go thanks
Albert Cardona II
@daddycardona
Sep 12 2017 01:23
here I am wanting to move there and bam it's almost gone
Moisés Man
@moigithub
Sep 12 2017 01:23
...so it doesnt say.. USE reduce method
Gersho
@Gersho
Sep 12 2017 01:24
irma and jose missed where i live by a hair (guadeloupe) we serve as waiting zone for the people wanting to go back to europe
Albert Cardona II
@daddycardona
Sep 12 2017 01:26

@moigithub it says this
`Here are some helpful links:

Arguments object
Array.prototype.reduce()`

so I am thinking they want me to use the reduce method
Gersho
@Gersho
Sep 12 2017 01:27
i looked at how i did it, i didn't use reduce
but i used the arguments object
Albert Cardona II
@daddycardona
Sep 12 2017 01:28
that is good @Gersho I have a lot of family down in florida
korzo
@korzo
Sep 12 2017 01:29
@Gersho That's a very nice place
Albert Cardona II
@daddycardona
Sep 12 2017 01:29
I am reallly pissed i don't understand what the hell I am doing with this
Gersho
@Gersho
Sep 12 2017 01:29
@korzo guadeloupe ? well, just like new york it looks nice on the postcards... ^^
korzo
@korzo
Sep 12 2017 01:29
@daddycardona Join all arguments.
Then use either filter or reduce to return final result
Albert Cardona II
@daddycardona
Sep 12 2017 01:30
I understand I need to make a array holding all the unique values of the 3 arrays lol
okay I will try thanks @korzo
CamperBot
@camperbot
Sep 12 2017 01:30
daddycardona sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 477 | @korzo |http://www.freecodecamp.com/korzo
Albert Cardona II
@daddycardona
Sep 12 2017 01:30
and thanks @Gersho and @moigithub
CamperBot
@camperbot
Sep 12 2017 01:30
daddycardona sends brownie points to @gersho and @moigithub :sparkles: :thumbsup: :sparkles:
:cookie: 415 | @gersho |http://www.freecodecamp.com/gersho
:star2: 3629 | @moigithub |http://www.freecodecamp.com/moigithub
Albert Cardona II
@daddycardona
Sep 12 2017 01:31
I hate when I am trying to use what they want me to use and I am like what the hell lol
Gersho
@Gersho
Sep 12 2017 01:34
you should see it as one way of doing it, coding is all about finding your own logic for things, so do it your way
Bhoomi Khanderia
@bhoomikhanderia
Sep 12 2017 01:36
Hello Everyone! I have an assignment to do on geoJSON. Can any one please suggest where to begin with?
Gersho
@Gersho
Sep 12 2017 01:37
i think w3schools has some ajax/JSON lessons
Albert Cardona II
@daddycardona
Sep 12 2017 01:37
@Gersho I do but then I realized my code is sufficiant for this or that but insoficciant for everything else lol while some code and it is convienient for all
Bhoomi Khanderia
@bhoomikhanderia
Sep 12 2017 01:38
@Gersho : I went through those lessons but I have to do an assignement on showing earthquake prone areas
Gersho
@Gersho
Sep 12 2017 01:39
then you should google for some API that will give you the info you need
Albert Cardona II
@daddycardona
Sep 12 2017 01:39
just console.log('california and Japan') and that is 97% complete lol
Gersho
@Gersho
Sep 12 2017 01:39
Italy too
Engjell Bislimi
@Engjell00
Sep 12 2017 01:39
Anyone can tell me how to link css and html together I create a folder called: Website; I put inside my html files , after I create another folder css and put my css file in it and it doesnt seem to work
Bhoomi Khanderia
@bhoomikhanderia
Sep 12 2017 01:39
@Gersho doing that. i am completely new to this so thought may be some might know
Gersho
@Gersho
Sep 12 2017 01:39
and wasn't mexico hit a few days ago ?
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 01:40
how are you linking it ? @Engjell00
Engjell Bislimi
@Engjell00
Sep 12 2017 01:40
image.png
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 01:40
@Gersho it was, by a earthquacke
Gersho
@Gersho
Sep 12 2017 01:40
as far as i can see your css should be loaded (assuming it's inside the folder and called style.css) @Engjell00
Albert Cardona II
@daddycardona
Sep 12 2017 01:41
@Engjell00 that looks correct what
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 01:41
@Engjell00 the file name is style.css?
try at href /css/style.css
Engjell Bislimi
@Engjell00
Sep 12 2017 01:41
I just wrote style at the file
i saved as type css
Mike Batista
@mbmontana
Sep 12 2017 01:42
Anyone know why I'm getting a syntax error on the "else" part of this code?
function mutation(arr) {
 var firstElement;
 var secondElement;
 var splitStr;
  firstElement = arr[0].toLowerCase();
  secondElement = arr[1].toLowerCase();
  splitStr = secondElement.split('');
 for (i = 0; i < splitStr.length; i++) {
 if (firstElement.indexOf(splitStr[i], 0) < 0)
 {return false;}

 }

 else {return true;}

}

mutation(["hello", "hey"]);
Gersho
@Gersho
Sep 12 2017 01:42
you're closing the if twice }
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 01:42
you have an extra } @mbmontana
Engjell Bislimi
@Engjell00
Sep 12 2017 01:42
thanks @NahuelOvejero @daddycardona @Gersho
CamperBot
@camperbot
Sep 12 2017 01:42
engjell00 sends brownie points to @nahuelovejero and @daddycardona and @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 416 | @gersho |http://www.freecodecamp.com/gersho
:cookie: 338 | @daddycardona |http://www.freecodecamp.com/daddycardona
:cookie: 797 | @nahuelovejero |http://www.freecodecamp.com/nahuelovejero
Albert Cardona II
@daddycardona
Sep 12 2017 01:43
:) glad we could help
function mutation(arr) {
 var firstElement;
 var secondElement;
 var splitStr;
  firstElement = arr[0].toLowerCase();
  secondElement = arr[1].toLowerCase();
  splitStr = secondElement.split('');
 for (i = 0; i < splitStr.length; i++) {
 if (firstElement.indexOf(splitStr[i], 0) < 0) {
    return false;
}
 else {
     return true;
}

}

mutation(["hello", "hey"]);
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 01:45
better
Albert Cardona II
@daddycardona
Sep 12 2017 01:45
@mbmontana your code would look cleaner after every for you sepparated it like that
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 01:46
yeah, still the code format here wrecks the indentation
Albert Cardona II
@daddycardona
Sep 12 2017 01:46
I am missing a closing bracket for the for loop
function mutation(arr) {
    var firstElement;
    var secondElement;
    var splitStr;
    firstElement = arr[0].toLowerCase();
    secondElement = arr[1].toLowerCase();
    splitStr = secondElement.split('');


    for (i = 0; i < splitStr.length; i++) {
        if (firstElement.indexOf(splitStr[i], 0) < 0) {
            return false;

        } else {
            return true;
        }
    }
}

mutation(["hello", "hey"]);
THere you go @mbmontana
Mike Batista
@mbmontana
Sep 12 2017 01:54
Well I solved that problem but not the challenge. I have to return true if every letter of the second string is in the first string, but false if not. These arguments keep returning true but they should be false.
function mutation(arr) {
 var firstElement;
 var secondElement;
 var splitStr;
  firstElement = arr[0].toLowerCase();
  secondElement = arr[1].toLowerCase();
  splitStr = secondElement.split('');


  for (i = 0; i < splitStr.length; i++) {
 if (firstElement.indexOf(splitStr[i], 0) < 0) {

   return false;  }

 else {return true;

        }
    }
}

mutation(["hello", "hey"]);
Gersho
@Gersho
Sep 12 2017 01:55
because return stops the function
so the first time you return either true or false, the function stops
Engjell Bislimi
@Engjell00
Sep 12 2017 01:56
image.png
Gersho
@Gersho
Sep 12 2017 01:57
try putting return true; outside your for loop (you don't need the else ) @mbmontana
Engjell Bislimi
@Engjell00
Sep 12 2017 01:57
in my website the picture and text in the header arent align together display:inline-block didn't work
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 01:57
what do you mean align together?
Engjell Bislimi
@Engjell00
Sep 12 2017 01:58
image.png
Like putting side by side like a logo with a tagline
I guess the picture is taking the 100% width I should reduce the one of the text too?
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 02:01
what you style css contain?
Engjell Bislimi
@Engjell00
Sep 12 2017 02:02
image.png
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 02:02
headers (h1, h2 etc) takes all
remove the text align
Engjell Bislimi
@Engjell00
Sep 12 2017 02:04
oh nice it work how come it did that? also how can i move the picture and the text? with the margin?
Nahuel Ovejero
@NahuelOvejero
Sep 12 2017 02:04
well, you were putting it in the center of the screen
yeah, you can play with margin-left or margin-rigth
Engjell Bislimi
@Engjell00
Sep 12 2017 02:07
the image doesnt seem to move
Mike Batista
@mbmontana
Sep 12 2017 02:09
@Gersho Is this what you mean? It doesn't work.
function mutation(arr) {
 var firstElement;
 var secondElement;
 var splitStr;
  firstElement = arr[0].toLowerCase();
  secondElement = arr[1].toLowerCase();
  splitStr = secondElement.split('');


  for (i = 0; i < splitStr.length; i++) {
 if (firstElement.indexOf(splitStr[i], 0) >= 0);}
  return true;

}

mutation(["hello", "hey"]);
Albert Cardona II
@daddycardona
Sep 12 2017 02:11
@Engjell00 did you have a ; at the end of that ?
Engjell Bislimi
@Engjell00
Sep 12 2017 02:11
image.png
image.png
I dont understand lol everything that I learn doesnt seem to work..
Gersho
@Gersho
Sep 12 2017 02:12
@mbmontana no i meant
function mutation(arr) {
 var firstElement;
 var secondElement;
 var splitStr;
  firstElement = arr[0].toLowerCase();
  secondElement = arr[1].toLowerCase();
  splitStr = secondElement.split('');


  for (i = 0; i < splitStr.length; i++) {
 if (firstElement.indexOf(splitStr[i], 0) < 0) {

   return false;  }

    }
return true;
}

mutation(["hello", "hey"]);
Albert Cardona II
@daddycardona
Sep 12 2017 02:13
I feel your pain but that is in line are you trying to make the text center of the picture? @Engjell00
Engjell Bislimi
@Engjell00
Sep 12 2017 02:13
image.png
i'm just trying to center the text and img more in the middle
Gersho
@Gersho
Sep 12 2017 02:14
@Engjell00 F12, spy their code :P
Albert Cardona II
@daddycardona
Sep 12 2017 02:14
I was about to say the same thing I just copy and paste half the stuff I use :)
Engjell Bislimi
@Engjell00
Sep 12 2017 02:16
I did that before but I just felt that I learned nothing doing that haha anyway I think I got it
it was a simple dot mistake lol
thanks @Gersho @daddycardona
CamperBot
@camperbot
Sep 12 2017 02:16
engjell00 sends brownie points to @gersho and @daddycardona :sparkles: :thumbsup: :sparkles:
api offline
api offline
Albert Cardona II
@daddycardona
Sep 12 2017 02:17
yes I have that happen to me all the time trust me it gets annoying @Engjell00
Gersho
@Gersho
Sep 12 2017 02:17
you learn nothing if you don't try to understand what you copy, but if you google up the keywords you don't know and understand why it works, i don't see anything wrong
Albert Cardona II
@daddycardona
Sep 12 2017 02:18
I copy and paste everything I understand or done before I don't copy and paste stuff I don't understand because then I can't manipulate it lol
Gersho
@Gersho
Sep 12 2017 02:18
Zeal is a lifesaver for this :D but i've added so many language it's a bit of a mess now
Albert Cardona II
@daddycardona
Sep 12 2017 02:23
I am only trying to master or get really good at javascript but I can't becaues even doing that haves issues like using react and other packages like jquery so confusing sometimes mixing them all up so just sticking to js now
Mike Batista
@mbmontana
Sep 12 2017 02:23
@Gersho Still doesn't work. I can only get false to return properly in this case
function mutation(arr) {
 var firstElement;
 var secondElement;
 var splitStr;
  firstElement = arr[0].toLowerCase();
  secondElement = arr[1].toLowerCase();
  splitStr = secondElement.split('');


  for (i = 0; i < splitStr.length; i++) {
 if (firstElement.indexOf(splitStr[i], 0) >= 0){

   return false;  }

    }
return true;
}

mutation(["hello", "hey"]);
Gersho
@Gersho
Sep 12 2017 02:26

why do you have

, 0

at the end of your indexOf ?

Mike Batista
@mbmontana
Sep 12 2017 02:27
@Gersho To indicate the index at which the search should start. I removed it and it didn't make a difference.
Gersho
@Gersho
Sep 12 2017 02:28
and also, isn't your condition reversed ? the way you turned it, it says that if you find the letter you search for, it should return false, shouldn't it be === -1 instead of >= 0?
Mike Batista
@mbmontana
Sep 12 2017 02:38
@Gersho That did it. Thanks! But why is strict equality required? I think even when I had it <= 0 that didn't work. @daddycardona @NahuelOvejero
CamperBot
@camperbot
Sep 12 2017 02:38
mbmontana sends brownie points to @gersho and @daddycardona and @nahuelovejero :sparkles: :thumbsup: :sparkles:
:cookie: 417 | @gersho |http://www.freecodecamp.com/gersho
:cookie: 339 | @daddycardona |http://www.freecodecamp.com/daddycardona
:cookie: 798 | @nahuelovejero |http://www.freecodecamp.com/nahuelovejero
Albert Cardona II
@daddycardona
Sep 12 2017 02:40
if you use == it will make 2 and '2' equal thought they are not one is a string and one is a value if you use === it makes it so that 2 and '2' are different I just learned that lol
Gersho
@Gersho
Sep 12 2017 02:40
<0 would have worked i guess, but not <=0 since if the answer is 0, it would break your expected result
and -1 is a special response for indexOf saying "i didn't find it"
but == -1 would probably work in this case, but it's a good habit (at least i think) to use strict comparison whenever possible
Engjell Bislimi
@Engjell00
Sep 12 2017 02:55
DO you see the picture and the text on top how can I align them lol I made a div inside I put a div text and a text image but doesnt seem to work
image.png
I actually use position: relative; and use the left and bottom is it worth it to do that?
Albert Cardona II
@daddycardona
Sep 12 2017 03:11
what do you mean align? like align which way
@Engjell00
or how would you like to align them on your page?
Engjell Bislimi
@Engjell00
Sep 12 2017 03:28
image.png
do you see the text in the border is taking all the space
but i want to center the text and the image by the right side
Albert Cardona II
@daddycardona
Sep 12 2017 03:29
so you want to center the duck and fly lik a Duck to the center what do you have so far
you can try in your css margin:auto;
Engjell Bislimi
@Engjell00
Sep 12 2017 03:32
i'm sorry my english suck
image.png
the image with the guy
and the text Future Front end developer blablabla..
Albert Cardona II
@daddycardona
Sep 12 2017 03:35
so you want the image of the guy to the left or right of the text?
Engjell Bislimi
@Engjell00
Sep 12 2017 03:35
to the right
and also center in page
with the text and image
Albert Cardona II
@daddycardona
Sep 12 2017 03:36
okay in that section of the page you want to put something like
.future{
margin:auto;
text-align:center;
}
.future img{
float: left;
}
if you want the image to be on the right its float:right;
Engjell Bislimi
@Engjell00
Sep 12 2017 03:41
image.png
@daddycardona so now should I play with the position of the image?
Albert Cardona II
@daddycardona
Sep 12 2017 03:43
if you created a codepen it would be so much easier to help you because I don't see your html or css code
Engjell Bislimi
@Engjell00
Sep 12 2017 03:44
image.png
image.png
Albert Cardona II
@daddycardona
Sep 12 2017 03:45
take the image div out of there you don't need a div just for an image if you want them in the same section
Engjell Bislimi
@Engjell00
Sep 12 2017 03:47
alright but it is still staying at the same place!
@daddycardona I guess I could use position: relative; but someone told me if I use it alot it won't be good in the future
Albert Cardona II
@daddycardona
Sep 12 2017 03:49
Okay you are using position relative for that image why?
Engjell Bislimi
@Engjell00
Sep 12 2017 03:50
I'm not using it I only put float : right; for now
image.png
I want to put the picture near there
I actually did display:inline-block;
image.png
but now they are far away from each other
Albert Cardona II
@daddycardona
Sep 12 2017 03:53
Okay I will find you an example so that you can see how it is done properly
Engjell Bislimi
@Engjell00
Sep 12 2017 03:54
@daddycardona sorry for all the trouble
this will help you understand put in in a <p> tag</p> then float:right and give a margin of margin:0 0 10px 10px;
Albert Cardona II
@daddycardona
Sep 12 2017 04:04
and if you want the pic to be closer to the center you can use
margin:0 20px 10px 10px;
Engjell Bislimi
@Engjell00
Sep 12 2017 04:06
ok so in the w3example
the image and the <p> is in 1 tag
Albert Cardona II
@daddycardona
Sep 12 2017 04:07
Yes and the image is actually the first thing in it
you are trying to make yours closer to the center correct
Engjell Bislimi
@Engjell00
Sep 12 2017 04:07
image.png
as you can see the text is now taking alll the space but the image is floating a the good side
Gersho
@Gersho
Sep 12 2017 04:07
there's no e to portfolio (even in french)
Engjell Bislimi
@Engjell00
Sep 12 2017 04:08
but I would like to minimize the width of the text so it could be group and now expanded like that
Albert Cardona II
@daddycardona
Sep 12 2017 04:08
I wish you would put this on code pen
Engjell Bislimi
@Engjell00
Sep 12 2017 04:08
hmm ok wait
Albert Cardona II
@daddycardona
Sep 12 2017 04:10
@Gersho you're wrong this is how you spell it in french portefeuille
Gersho
@Gersho
Sep 12 2017 04:10
portefeuille yes, but not portfolio
Albert Cardona II
@daddycardona
Sep 12 2017 04:10
LOL there is olio in the french version lmao
a portefeuille is the thing you put your money in (the bills)
Engjell Bislimi
@Engjell00
Sep 12 2017 04:12
I think he was joking but anyway i just made a typo on portefolio
portfolio
lool
piteto
@piteto
Sep 12 2017 04:13
isn't it also portfolio in french?
Albert Cardona II
@daddycardona
Sep 12 2017 04:13
LOL it's cool
piteto
@piteto
Sep 12 2017 04:14
Veuillez consulter mon site Web pour voir l'intégralité de mon portefolio?
Gersho
@Gersho
Sep 12 2017 04:14
isn't it also portfolio in french?
that's what i was explaining
piteto
@piteto
Sep 12 2017 04:14
ahhh, I see lol
Engjell Bislimi
@Engjell00
Sep 12 2017 04:14
Non, j'ai simplement faite une erreur
Gersho
@Gersho
Sep 12 2017 04:15
we use the english word in french, and portfeuille is a unrelated word
Engjell Bislimi
@Engjell00
Sep 12 2017 04:15
I mean that's all good but the only thing you could help was a typo
that's kinda sad
Gersho
@Gersho
Sep 12 2017 04:16
i don't help on css :p
Albert Cardona II
@daddycardona
Sep 12 2017 04:17
I don't know what happened to the duck thing but i fixed your image
Engjell Bislimi
@Engjell00
Sep 12 2017 04:18
@daddycardona I used the position relative so I guess it only fit my screen size
Albert Cardona II
@daddycardona
Sep 12 2017 04:18
No I don't know why you used position in there where do you want the duck to be
Engjell Bislimi
@Engjell00
Sep 12 2017 04:21
I have no idea lol ive tried to make a portfolio with css and html only it's been 5 days I'm still lost on all that position thing lol
i'm just trying different thing
nothing seems to work
Albert Cardona II
@daddycardona
Sep 12 2017 04:21
See I put the image <img tag in the <p> tag then you can see i added .text img{ and fixed your image positioning
well take it one section at a time don't try anything else until you get the header how you like it
then worry about the other section @Engjell00
Engjell Bislimi
@Engjell00
Sep 12 2017 04:23
ok but now what if i want the imag and the text
to be in the center
Albert Cardona II
@daddycardona
Sep 12 2017 04:23
you should create a template I use to do it
Engjell Bislimi
@Engjell00
Sep 12 2017 04:23
and to leave a white space in each right
Albert Cardona II
@daddycardona
Sep 12 2017 04:24
well now you have to use padding and margin for the div
Engjell Bislimi
@Engjell00
Sep 12 2017 04:24
so when i'll use the padding the text won't be enlarge like that^
Gersho
@Gersho
Sep 12 2017 04:25
it may sound like i'm trying to add more complexity to your trouble, but you should try bootstrap, it has a lot of built in stuff that could help you
Engjell Bislimi
@Engjell00
Sep 12 2017 04:26
@Gersho You are actually right I did learn it with the jumbotron and container it was actually so amazing!
but I really want to understand the css fundamentals
Gersho
@Gersho
Sep 12 2017 04:26
then try taking a look at the css grid system
Engjell Bislimi
@Engjell00
Sep 12 2017 04:28
wait so the row and the col-xs-4 is css not bootstrap?
or you need w3-col-xs
Gersho
@Gersho
Sep 12 2017 04:29
never used w3 css so i don't know about your second question, but row/col-x is standard css
bootstrap probably has more fancy options
Albert Cardona II
@daddycardona
Sep 12 2017 04:32
that is the boostrap sorry and w3 is basically the standards for css and html
Engjell Bislimi
@Engjell00
Sep 12 2017 04:43
how come freecodecamp doesnt talk about it?
Albert Cardona II
@daddycardona
Sep 12 2017 04:48
you need to youtube it lol
@Engjell00
I am just redoing some of the things you are doing. 1 Make sure you keep your names lowercase. 2. never put your body after your header or div it goes after </head> I also put everything in a div with a class called container
Engjell Bislimi
@Engjell00
Sep 12 2017 04:49
well example if i work for a compagny I dont know how to place like I ask you but I know with bootstrap or w3 would they engage me lol
piteto
@piteto
Sep 12 2017 04:49
bootstrap, yes, w3, no way :p
Engjell Bislimi
@Engjell00
Sep 12 2017 04:50
I just don't seem to understand how the hell do I position the content lool
Albert Cardona II
@daddycardona
Sep 12 2017 04:50
your ul hrefs shoulr look like this since you're linking it to an anchor tag to section of your page < a href="#home">Home</a>
and you should give them id's too like <div id="home">
lol
I remember them days too lol
Engjell Bislimi
@Engjell00
Sep 12 2017 04:53
it's only been a week but i guess im just impatient haha
Engjell Bislimi
@Engjell00
Sep 12 2017 04:59
@daddycardona thank you so much for your help! I really appreciate it have a good night
CamperBot
@camperbot
Sep 12 2017 04:59
engjell00 sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
:cookie: 340 | @daddycardona |http://www.freecodecamp.com/daddycardona
Albert Cardona II
@daddycardona
Sep 12 2017 04:59
you too brother I am trying to fix some stuff too :)
Darren
@DarrenfJ
Sep 12 2017 05:03
evening fCC
Gersho
@Gersho
Sep 12 2017 05:03
yo Darren
Darren
@DarrenfJ
Sep 12 2017 05:04
@Gersho hey man :D
Michael Bomholt
@bomholtm
Sep 12 2017 05:45
does anyone have information on the state of beta? my account seems disabled
Darren
@DarrenfJ
Sep 12 2017 05:48
@bomholt yah it's locked out now...
i think there used to be a way to get in if you already had logged in but i think that might be disabled too now
Michael Bomholt
@bomholtm
Sep 12 2017 05:49
@DarrenfJ i was logged in. but i got locked out of it
Gersho
@Gersho
Sep 12 2017 05:49
i heard stuff wasn't saved on beta
Michael Bomholt
@bomholtm
Sep 12 2017 05:49
no stuff isn't saved
should let you log it (or used to anyway)
Manish Giri
@Manish-Giri
Sep 12 2017 05:50
@DarrenfJ x
Michael Bomholt
@bomholtm
Sep 12 2017 05:50
and i understand that beta users have to be limited but it seems no one can use the beta anymore
Gersho
@Gersho
Sep 12 2017 05:50
i'm on codewars at the moment, trying some kata, but i can't seem to be able to use console.log, any workaround ?
Darren
@DarrenfJ
Sep 12 2017 05:50
@Gersho yah used to save stuff but note that when they go live with it all progress will be lost
Manish Giri
@Manish-Giri
Sep 12 2017 05:51
console.log works for me in codewars
Darren
@DarrenfJ
Sep 12 2017 05:51
@Gersho you can console log and it shows up in the left results panel
Michael Bomholt
@bomholtm
Sep 12 2017 05:51

@DarrenfJ Welcome to the freeCodeCamp beta.
We have disabled new sign ups on beta.
You can try our new beta challenges, but your progress will not be saved. Click here to go to the beta challenges .

Or you can return to our stable challenges, where your progress will be saved. Click here to go to the stable challenges .

If you want to learn more about this beta, read our Frequently Asked Questions .

Happy coding!

Darren
@DarrenfJ
Sep 12 2017 05:51
@Manish-Giri this is my life ha! that corgi ;)
Manish Giri
@Manish-Giri
Sep 12 2017 05:52
mine too
:dog:
Darren
@DarrenfJ
Sep 12 2017 05:52
@bomholt i think when they were fixing the db crash beta logins for existing logins got borked tbh
Michael Bomholt
@bomholtm
Sep 12 2017 05:53
@DarrenfJ not sure what to do now :smile:
Darren
@DarrenfJ
Sep 12 2017 05:54
wait ;)
forever :P
@Gersho what's yer codewars name.. can go friend or follow yah or whatever they call it over there...
Gersho
@Gersho
Sep 12 2017 05:55
oh ok i finally found the log on the left >-> it was so nicely display i didn't pay attention to it
i clearly dropped the ball on that one, thanks @DarrenfJ @Manish-Giri
CamperBot
@camperbot
Sep 12 2017 05:55
gersho sends brownie points to @darrenfj and @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 2018 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 6529 | @manish-giri |http://www.freecodecamp.com/manish-giri
Darren
@DarrenfJ
Sep 12 2017 05:55
yah it's hidden right in theere
Manish Giri
@Manish-Giri
Sep 12 2017 05:56
about @rphares
CamperBot
@camperbot
Sep 12 2017 05:56
:star2: 6596 | @rphares |http://www.freecodecamp.com/rphares
Gersho
@Gersho
Sep 12 2017 05:56
https://www.codewars.com/users/Gersho
but i'm super newbie on this, i saw you 2 talking earlier about doing 2 kata a day and decided i'd do that too
Manish Giri
@Manish-Giri
Sep 12 2017 05:56
almost there
lol
Darren
@DarrenfJ
Sep 12 2017 05:56
yer getting close :D
@Gersho coolCool
Gersho
@Gersho
Sep 12 2017 05:57
wanted to do 1 JS and 1 python, but my python isn't really up to it yet
Darren
@DarrenfJ
Sep 12 2017 05:57
i'm only at 7kyu so really a very noobie myself.. and my solutions are always clunky and way more lines than they should be..
that's me
lol
Darren
@DarrenfJ
Sep 12 2017 05:57
i want to do some Ruby in there too but my Ruby-fu is still weak
Gersho
@Gersho
Sep 12 2017 05:58
done and done
Eunice Park
@eunicode
Sep 12 2017 05:58

Sorry to interrupt this convo, I'd like to ask for some help. I'm reading Eloquent JavaScript and I'm having trouble understanding a scope example.
http://eloquentjavascript.net/03_functions.html#h_u4j2OhpYkg

var x = "outside";

var f1 = function() {
  var x = "inside f1";
};
f1();
console.log(x);
// → outside

var f2 = function() {
  x = "inside f2";
};
f2();
console.log(x);
// → inside f2

Why don't the functions have return statements? And does the second console.log(x) output "inside f2" bc the second function changed the global variable?

Gersho
@Gersho
Sep 12 2017 05:59
well now, since i've "fixed" my console issues, i'll get back to trying to actually solve the thing :)
Manish Giri
@Manish-Giri
Sep 12 2017 05:59

@eunipa

And does the second console.log(x) output "inside f2" bc the second function changed the global variable?

yes
also a function returns undefined by default, if you don't have a return of your own
Darren
@DarrenfJ
Sep 12 2017 06:00
@eunipa yes to what manish said...
Gersho
@Gersho
Sep 12 2017 06:00
@eunipa when you DECLARE a variable (using var) it evaluate the scope at that moment, but if you reuse a variable whose scope was declared earlier (as in f2 exemple) it retains it's old scope
Darren
@DarrenfJ
Sep 12 2017 06:01
but also doesn't have to return anything since you are trying to change a variable within the function and then loggin that
Eunice Park
@eunicode
Sep 12 2017 06:01
@Manish-Giri @Gersho @DarrenfJ Thank you. How does the global variable get changed if the function doesn't return anything? Sorry if that's a dumb question.
CamperBot
@camperbot
Sep 12 2017 06:01
eunipa sends brownie points to @manish-giri and @gersho and @darrenfj :sparkles: :thumbsup: :sparkles:
:cookie: 418 | @gersho |http://www.freecodecamp.com/gersho
:star2: 2019 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 6530 | @manish-giri |http://www.freecodecamp.com/manish-giri
Darren
@DarrenfJ
Sep 12 2017 06:01
it's the essence of scope.. if you can change it, it will log the change.. if you can't it doesn't.. returning doesn't affect it
Manish Giri
@Manish-Giri
Sep 12 2017 06:02
^
Gersho
@Gersho
Sep 12 2017 06:02
the fact that f1 use it's own scope, allows you to use external scripts that have their own variable names, since they are set within the function with var (so limited to their scope) it won't make trouble even if they use the same variable name as you did
Darren
@DarrenfJ
Sep 12 2017 06:02
there is no spoon

@eunipa not a dumb question.. the very question of scope

@Manish-Giri @Gersho @DarrenfJ Thank you. How does the global variable get changed if the function doesn't return anything? Sorry if that's a dumb question.

CamperBot
@camperbot
Sep 12 2017 06:03
darrenfj sends brownie points to @eunipa and @manish-giri and @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 419 | @gersho |http://www.freecodecamp.com/gersho
:cookie: 278 | @eunipa |http://www.freecodecamp.com/eunipa
:star2: 6531 | @manish-giri |http://www.freecodecamp.com/manish-giri
Darren
@DarrenfJ
Sep 12 2017 06:03
the global variables changes on this line x = "inside f2";
Gersho
@Gersho
Sep 12 2017 06:03

How does the global variable get changed if the function doesn't return anything? Sorry if that's a dumb question.

for a function, DOING stuff and RETURNING stuff are different things, for exemple array.forEach does not return anything , but array.map() will return something, so to "obtain" it's result, you need to do x = array.map()

Darren
@DarrenfJ
Sep 12 2017 06:03
you reassign it's value there
Eunice Park
@eunicode
Sep 12 2017 06:04
Thank you guys.
@DarrenfJ Thank you for the detailed explanation. This is pretty interesting. I guess I'll have to do some more reading on scope
CamperBot
@camperbot
Sep 12 2017 06:04
eunipa sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
api offline
Gersho
@Gersho
Sep 12 2017 06:04
and it died again
Darren
@DarrenfJ
Sep 12 2017 06:05
@eunipa here (in f1) var x = "inside f1"; you are not changing the value but declaring and assigning a local scope (only applicable inside the function)
Manish Giri
@Manish-Giri
Sep 12 2017 06:05
maybe read YDKJS before eloquent JS
it's a bit more beginner friendly
@eunipa
Darren
@DarrenfJ
Sep 12 2017 06:07
i saw a ticket on the api thing and now it does this offline thing if you already have a brownie whereas it used to give you the warning that it cannot give you another
Manish Giri
@Manish-Giri
Sep 12 2017 06:08
yea
@DarrenfJ ty
CamperBot
@camperbot
Sep 12 2017 06:08
manish-giri sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2020 | @darrenfj |http://www.freecodecamp.com/darrenfj
Eunice Park
@eunicode
Sep 12 2017 06:08
@Manish-Giri Thanks, I'll read the scope book to understand scope better. Though I think p1xt said that YDKJS was more rigorous than Eloquent JS
Darren
@DarrenfJ
Sep 12 2017 06:08
freeCodeCamp/freeCodeCamp#15857

from berkley: "Thanks for the notification. It is still working, it's just that trying to send two thanks to the same person hits a rate limit and will respond with an error.

Generally the server responds with JSON but I think the way our error messages are now handled are catching message through the API that should be sent directly to the client. I'll need to fix this in our codebase.

Campers are still getting their points, though."

everything new is old again
hey 2020!
i can see!
Gersho
@Gersho
Sep 12 2017 06:11
earlier i discovered the camperbot is mean :(
Henry
@GitHub-Henry
Sep 12 2017 06:16
eightball is cbot mean?
CamperBot
@camperbot
Sep 12 2017 06:16
@GitHub-Henry :8ball: it is certain :sparkles:
Henry
@GitHub-Henry
Sep 12 2017 06:17
What can I say, eightball has spoken.
Gersho
@Gersho
Sep 12 2017 06:17
told you
Darren
@DarrenfJ
Sep 12 2017 06:23
eightball is cbot mean?
CamperBot
@camperbot
Sep 12 2017 06:23
@DarrenfJ :8ball: most likely :sparkles:
Darren
@DarrenfJ
Sep 12 2017 06:28
ok gonna sneak off to bed...
later codeJunkies
Gersho
@Gersho
Sep 12 2017 06:28
cya Darren
Henry
@GitHub-Henry
Sep 12 2017 06:28
gn
Eunice Park
@eunicode
Sep 12 2017 06:29
Goodnight kind stranger
chuck
@chuckreaper
Sep 12 2017 07:06
Hey guys, 'fore you sleep, I need help with a project here https://codepen.io/chuckreaper/pen/bRdbKr
Gersho
@Gersho
Sep 12 2017 07:08
so what's the problem ? it seem to work
chuck
@chuckreaper
Sep 12 2017 08:21
@Gersho If I use \n tag on the JS array, it prints when I share it on twitter but does not on the site
@Gersho but the br tag works in the site yet but doesn't work on twitter
@Gersho sorry it took so long to reply, lights went out for an hr or so
Stephen James
@sjames1958gm
Sep 12 2017 10:07
@chuckreaper Don't know if you are still on - but that line with the .css color green is breaking it because it uses i which is not defined you don't get the twitter button 'click' handler assigned
Morchid Chellali
@Morched23MJ
Sep 12 2017 11:09
Who's familiar with Github pages, I need help.
Saber I.
@icybears
Sep 12 2017 11:09
i'm not that familiar
but try me
Morchid Chellali
@Morched23MJ
Sep 12 2017 11:10
I added a <title> and an <link> for an icon, for the page, it worked in the first minutes, now I see the url, instead of the title, entered the html, and found that <title> wasn't there.
Is Github Pages removing those <title> and <link>? or I have to try many times so that Github save that up?
Saber I.
@icybears
Sep 12 2017 11:11
no ?
how comes github changes what is in ur index.html
Morchid Chellali
@Morched23MJ
Sep 12 2017 11:11
I thought so, too.
Still dunno why those two are gettin' removed..
Saber I.
@icybears
Sep 12 2017 11:12
jsut reload ur page or something
Morchid Chellali
@Morched23MJ
Sep 12 2017 11:12
Alright, I'll try again, gtg, thank you, @icybears
CamperBot
@camperbot
Sep 12 2017 11:12
morched23mj sends brownie points to @icybears :sparkles: :thumbsup: :sparkles:
:cookie: 105 | @icybears |http://www.freecodecamp.com/icybears
heroiczero
@heroiczero
Sep 12 2017 11:16
@Morched23MJ maybe it didn't save your changes or you did not commit the changes?
chuck
@chuckreaper
Sep 12 2017 11:30
@sjames1958gm yeah, I figured that was not working .. removed it
Need help... Anyone know a way to target an element in multidimensional JS array using jquery?
@heroiczero don't get it
heroiczero
@heroiczero
Sep 12 2017 11:34
@chuckreaper what do you want to do with the target element?
chuck
@chuckreaper
Sep 12 2017 11:34
@heroiczero I need to change its color and font-size (the 2 element in the arrays -- author)
heroiczero
@heroiczero
Sep 12 2017 11:36
@chuckreaper that would be CSS, and add classes if it is a certain element in the array like if [2] then addClass()
Bhoomi Khanderia
@bhoomikhanderia
Sep 12 2017 12:09
Hello!I am working on this: I need to create a mobile responsive web page to display locations of earthquake around the world on a map. The actual API: https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson
Please let me know if anyone know anything that would help me! TIA
_
heroiczero
@heroiczero
Sep 12 2017 12:11
@Bhoomi-Github you may want to use the Google map API
Bhoomi Khanderia
@bhoomikhanderia
Sep 12 2017 12:12
This is my assignment. Also, it s written GET request will return JSON in the format{...} I am not familiar with JSON
heroiczero
@heroiczero
Sep 12 2017 12:12
Gersho
@Gersho
Sep 12 2017 12:13
@Bhoomi-Github you need to check lessons about manipulating javascript Objects
heroiczero
@heroiczero
Sep 12 2017 12:13
@Bhoomi-Github can you use Jquery or do you want to use native javascript
Bhoomi Khanderia
@bhoomikhanderia
Sep 12 2017 12:13
@heroiczero : Thank you! I have used Google Maps API before but wasnt sure how to work around JSON
CamperBot
@camperbot
Sep 12 2017 12:13
bhoomi-github sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1718 | @heroiczero |http://www.freecodecamp.com/heroiczero
Bhoomi Khanderia
@bhoomikhanderia
Sep 12 2017 12:16
@Gersho : Thanks for replying! Will check that
CamperBot
@camperbot
Sep 12 2017 12:16
bhoomi-github sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 420 | @gersho |http://www.freecodecamp.com/gersho
1LifeLess
@1LifeLess
Sep 12 2017 12:16
I have question, what's the different between a js object
''' {a :'10:00', b:'09:00'} '''
and
'''{'a' :'10:00', 'b':'09:00'}'''
The problem is, that the first one won't work on Jquery $.each()
CamperBot
@camperbot
Sep 12 2017 12:16
:bulb: to format code use backticks! ``` more info
Gersho
@Gersho
Sep 12 2017 12:17
@1LifeLess the one without quotes around property names is a JS object, the one with quote is a JSON
1LifeLess
@1LifeLess
Sep 12 2017 12:18
@Gersho So why $.each() will only work in JSON object?
Gersho
@Gersho
Sep 12 2017 12:20
.each( function )
Description: Iterate over a jQuery object, executing a function for each matched element.
1LifeLess
@1LifeLess
Sep 12 2017 12:23
@Gersho hmmm... ok thanks
CamperBot
@camperbot
Sep 12 2017 12:23
1lifeless sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 421 | @gersho |http://www.freecodecamp.com/gersho
Michael Oliver
@Michael3353
Sep 12 2017 13:15
hi all. been a while. sorry been away so long. my tribute page is coming along nicely now mind. just finishing off html side before starting the css part.
heroiczero
@heroiczero
Sep 12 2017 13:16
@Michael3353 Welcome back to FCC community :) Glad your back
Michael Oliver
@Michael3353
Sep 12 2017 13:18
yea. i decided to not start directly from beginning but from maybe a chapter or 2 from where i left off. I left off in basic js, so started back up in the middle of html, and suprisingly, because I'd not stopped watching html/css videos I flew through it where I struggled before haha. so.. felt good tbh. and it's nice to do some js and actually work it out, rather than get a hint that inevitably shows the answer.
not sure what the deal is with sharing where i am at the moment but..
that how it looks at the moment. as I say. sorting html before css
heroiczero
@heroiczero
Sep 12 2017 13:21
@Michael3353 Well its decent start just have to add those CSS :)
Michael Oliver
@Michael3353
Sep 12 2017 13:28
yea. Bit of html left towards the bottom and then. finish up the css :) I'm super proud of this. Because when I left I tried to find a biler plater sort of thing. But with this Ive pretty much done it from scratch so, its good to see I'm making big strides to start with.
boiler*
Sandip Shrestha
@saninmersion
Sep 12 2017 14:53
@Michael3353 the layout design is what will be frustrating then the html part. When you do get stuck with the design and layout along with css try visiting similar sites or visit dribble.com for inspiration.
Michael Oliver
@Michael3353
Sep 12 2017 14:53
@saninmersion awesome cheers. will do :)
quickspeedy
@quickspeedy
Sep 12 2017 16:43
How do you console log multidimensional arrays? I am working on profile lookup exercise. I tried console.log(contacts[i]) within the for loop. The console return blank.
Gersho
@Gersho
Sep 12 2017 16:44
it's not a multidimentional array, it's an array containing Objects
quickspeedy
@quickspeedy
Sep 12 2017 16:51
@Gersho Ok, and why doesn't contact[0].firstName work in console log?
Gersho
@Gersho
Sep 12 2017 16:54
try console.log(JSON.stringify(contact[0]));
objects don't show up in logs normally
quickspeedy
@quickspeedy
Sep 12 2017 16:55
@Gersho I still get blanks.
Gersho
@Gersho
Sep 12 2017 16:56
try console.log(contact[0].firstName);
you should get "Akira" as result
quickspeedy
@quickspeedy
Sep 12 2017 16:57
I should but I still get blank which is weird.
Gersho
@Gersho
Sep 12 2017 16:58
oh wait
Alexander Køpke
@alexanderkopke
Sep 12 2017 16:58
@quickspeedy what happens if you do console.table(contacts[0]);
Gersho
@Gersho
Sep 12 2017 16:58
are you talking about the black window at the left of the challenge ?
quickspeedy
@quickspeedy
Sep 12 2017 16:58
@alexanderkopke I still get blank
@Gersho Yes.
Gersho
@Gersho
Sep 12 2017 16:59
press F12
quickspeedy
@quickspeedy
Sep 12 2017 16:59
ok
Gersho
@Gersho
Sep 12 2017 16:59
find the tab named "console"
CamperBot
@camperbot
Sep 12 2017 16:59
find the tab named console
nothing found
Alexander Køpke
@alexanderkopke
Sep 12 2017 16:59
oh cbot you! :heart:
quickspeedy
@quickspeedy
Sep 12 2017 17:00
ok
Gersho
@Gersho
Sep 12 2017 17:01
well this is where console.log stuff appears (make sure you're not filtering out JS)
quickspeedy
@quickspeedy
Sep 12 2017 17:02
@Gersho by filtering out JS, you mean to keep javascript error enabled?
Gersho
@Gersho
Sep 12 2017 17:03
error/exeption or whatever it's named in your browser yes
quickspeedy
@quickspeedy
Sep 12 2017 17:04
@Gersho Ok after trying console.log(JSON.stringify(contact[0])); I still get a blank in the console.
Gersho
@Gersho
Sep 12 2017 17:06
can you show your full code ?
quickspeedy
@quickspeedy
Sep 12 2017 17:08
I think I may have found the problem. It must be an issue with Firefox. I tested it on Chrome and it did return the objects.
Gersho
@Gersho
Sep 12 2017 17:09
could be whitespace trouble too, pretty rare but happens sometimes
quickspeedy
@quickspeedy
Sep 12 2017 17:11
@Gersho True, thanks for the help!
CamperBot
@camperbot
Sep 12 2017 17:11
quickspeedy sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 422 | @gersho |http://www.freecodecamp.com/gersho
NAVANEETH
@NAVANEETH1
Sep 12 2017 17:16
can some one tell which is the best code editor for web development
Christopher McCormack
@cmccormack
Sep 12 2017 17:26
@NAVANEETH1 I like to recommend VS Code, some people recommend WebStorm, but any text editor can create the files you need, it's more about what other tools you want at your disposal.
NAVANEETH
@NAVANEETH1
Sep 12 2017 17:27
i am a beginner
so?
Christopher McCormack
@cmccormack
Sep 12 2017 17:31
So start coding with what you have, and when you want something more powerful you can research your options
Brian Mugisa
@brianmugisa
Sep 12 2017 17:48
Hi everyone!
I need help with FCC profile lookup code - an explanation of code behavior

Here is my question:
I have spent hours trying to understand this - I know it has something to do with if...else statement logic order, but each time I have tried to follow I got lost. Someone please explain this to me and if possible give a pointer of how to handle if...else logic order(a hack/ quick method to remember e.g: "always start with the larger sample space ...")

Here it is:

The Task is as follows:
We have an array of objects representing different people in our contacts lists.

A lookUpProfile function that takes firstName and a property (prop) as arguments has been pre-written for you.

The function should check if firstName is an actual contact's firstName and the given property (prop) is a property of that contact.

If both are true, then return the "value" of that property.

If firstName does not correspond to any contacts then return "No such contact"

If prop does not correspond to any valid properties then return "No such property"

CODE
This code is wrong

var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];

function lookUpProfile(firstName, prop){

  for(var i=0;i < contacts.length;i++){

    if (contacts[i].hasOwnProperty(prop))
      {
        if(contacts[i].firstName === firstName){
          return contacts[i][prop];
        }
        else {
          return "No such contact";
        }

      }
// Only change code above this line
}
  return "No such property";
}
// Change these values to test your function
lookUpProfile("Harry", "likes");

THIS code is correct:

var contacts = [
    {
        "firstName": "Akira",
        "lastName": "Laine",
        "number": "0543236543",
        "likes": ["Pizza", "Coding", "Brownie Points"]
    },
    {
        "firstName": "Harry",
        "lastName": "Potter",
        "number": "0994372684",
        "likes": ["Hogwarts", "Magic", "Hagrid"]
    },
    {
        "firstName": "Sherlock",
        "lastName": "Holmes",
        "number": "0487345643",
        "likes": ["Intriguing Cases", "Violin"]
    },
    {
        "firstName": "Kristian",
        "lastName": "Vos",
        "number": "unknown",
        "likes": ["Javascript", "Gaming", "Foxes"]
    }
];

function lookUpProfile(firstName, prop){

  for(var i=0;i < contacts.length;i++){

    if (contacts[i].firstName === firstName)
      {
        if(contacts[i].hasOwnProperty(prop)){
          return contacts[i][prop];
        }
        else {
          return "No such property";
        }

      }
// Only change code above this line
}
  return "No such contact";
}
// Change these values to test your function
lookUpProfile("Harry", "likes");

I will really appreciate if someone can help me explain the difference. Thank you in advance!

Stephen James
@sjames1958gm
Sep 12 2017 17:53
@brianmugisa In the incorrect code it will return no such contact when it encounters the first contact with the property that isn't a first name match.
it will not check every contact before declaring no such contact.
Because of that it will return no such contact on Akira and never make it two Harry.
The second code only makes that check when the first name does match
Brian Mugisa
@brianmugisa
Sep 12 2017 18:20

@sjames1958gm Thank you. I see this - the return should ONLY be given a chance to be initiated once the unique value has been recognized/true. By unique value I mean "akira for example, or "Harry". The other (not unique value is the property, which all of them have as a key.

Once again thank you for your rephrasing.

CamperBot
@camperbot
Sep 12 2017 18:20
brianmugisa sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8459 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Randell Dawson
@RandellDawson
Sep 12 2017 19:05
@brianmugisa - I answered your question about an hour ago on the forum.
Brian Mugisa
@brianmugisa
Sep 12 2017 19:07
I saw it @randelldawson . Had posted the same here at the same time. Thank you!
CamperBot
@camperbot
Sep 12 2017 19:07
brianmugisa sends brownie points to @randelldawson :sparkles: :thumbsup: :sparkles:
:cookie: 303 | @randelldawson |http://www.freecodecamp.com/randelldawson
Pethaf
@Pethaf
Sep 12 2017 19:11
Fisk?
Yash Bhardwaj
@imyashbhardwaj
Sep 12 2017 19:32
can anyone tell me where can i find the solutions to various how-to-npm excercises???
Gersho
@Gersho
Sep 12 2017 19:34
google
Yash Bhardwaj
@imyashbhardwaj
Sep 12 2017 19:34

@Gersho cant find it

thats why asking here

Roundy
@Vosslc
Sep 12 2017 20:43
image.png
Can someone help me with this?
Plaese and thanks
Stephen James
@sjames1958gm
Sep 12 2017 21:17
@Vosslc Looks like you wrapped your checkboxes as well as your radio buttons. move closing </div> up
Albert Cardona II
@daddycardona
Sep 12 2017 21:44
@imyashbhardwaj you can go to www.stackoverflow.com www.dreamincode.net or youtube and search on youtube. Youtube literally haves someone doing all the challenges and it sucks because I want to learn something I ended up just copying his code and was like shit i cheated
Gersho
@Gersho
Sep 12 2017 22:06
well, where is your curInv declaration ? (newInv too)
the fcc challenge explains it makes a backup of the inventory to be able to compare to verify your result
aRtoo
@artoodeeto
Sep 12 2017 22:08
@Gersho yea i deleted it. didnt notie
Eric Miller
@ericmiller777
Sep 12 2017 22:10
hey guys
how can i get the numbers centered with the buttons?
Gersho
@Gersho
Sep 12 2017 22:12
remove float left ?
Eric Miller
@ericmiller777
Sep 12 2017 22:12
then theyer just in the center of the screen?
Gersho
@Gersho
Sep 12 2017 22:13
oh you made them that way
first of you should avoid using <hx> types elements for this kind of use
(i was expecting the number to be part of a group with the 2 buttons)
Eric Miller
@ericmiller777
Sep 12 2017 22:14
i tryed that andthen
theny all became side by side
Gersho
@Gersho
Sep 12 2017 22:14
grid can be a b..... yeah
Eric Miller
@ericmiller777
Sep 12 2017 22:14
what are <hx> types btw?
Gersho
@Gersho
Sep 12 2017 22:14
h1 h2 etc
Eric Miller
@ericmiller777
Sep 12 2017 22:15
what i can do is just make them side by side
Gersho
@Gersho
Sep 12 2017 22:16
try, instead of col-12 with everything, have col-1 with the buttons and the text, col-10 empty, col-1 with the other buttons and text
Eric Miller
@ericmiller777
Sep 12 2017 22:16
1 sec waiting for it to update
Gersho
@Gersho
Sep 12 2017 22:16
or 2/8/2
hmm
Gersho
@Gersho
Sep 12 2017 22:17
by the way why do you want the buttons so far apart ?
Eric Miller
@ericmiller777
Sep 12 2017 22:17
so you wamme leave it as 3 groups?
um
idk
Gersho
@Gersho
Sep 12 2017 22:17
3 columns, 1 small 1 big 1 small (how small depending on where you want your buttons)
or even 1 empty 1 button 1 big 1 button 1 empty
as long as the total is 12 anything goes (even nesting)
Eric Miller
@ericmiller777
Sep 12 2017 22:20
thats acting a bit weird
1 sec
in game dev, I would make a object of those 3 items
Gersho
@Gersho
Sep 12 2017 22:22
it turned crazy :D when manipulating col/div changing background color of element can help to see what is where
Eric Miller
@ericmiller777
Sep 12 2017 22:22
then use that
doe sjavascript have somthing like that?
Gersho
@Gersho
Sep 12 2017 22:23
no idea sorry
Eric Miller
@ericmiller777
Sep 12 2017 22:23
might just do it side by side
because i think if we do get it
its not going to be responcive
sive
Gersho
@Gersho
Sep 12 2017 22:24
with col it should be
Eric Miller
@ericmiller777
Sep 12 2017 22:24
yea but how can we get it centered without messing with the margins?
Gersho
@Gersho
Sep 12 2017 22:24
btw when trying to build your page, you should consider codepen, it's easier for ppl to check code
Eric Miller
@ericmiller777
Sep 12 2017 22:24
yea
Gersho
@Gersho
Sep 12 2017 22:26
i don't know much about css, but isn't all your col-xx-1 the sale as having col-1 ?
Eric Miller
@ericmiller777
Sep 12 2017 22:28
yes but i might change that depending on how it looks on mobile
I think i have an idea
Jake
@JakeDVirus
Sep 12 2017 22:35

suppose i have a code like this

function rough1(){
    followingList[i];
   //some other statements
};

function rough2(){
    var followingList =[Array];
   //some other statements
    function rough3(){
          rough1(){};
    }
}

according to name-resolution lookup and execution context, the function rough1 will have access to the variable followingList when called inside the function rough3.
Am i right or wrong?
Actually in my specific piece of code the variable followingList is said to be not defined when called in this manner.

Eric Miller
@ericmiller777
Sep 12 2017 22:36
@Gersho made two divs then centered those :)
Gersho
@Gersho
Sep 12 2017 22:39
\o/
Eric Miller
@ericmiller777
Sep 12 2017 23:11
@Gersho thanks
CamperBot
@camperbot
Sep 12 2017 23:11
ericmiller777 sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 424 | @gersho |http://www.freecodecamp.com/gersho
hazelnuter
@hazelnuter
Sep 12 2017 23:28
yo
Randell Dawson
@RandellDawson
Sep 12 2017 23:52
@NeelDVirus - Can you show how you are trying to call rough3?
hazelnuter
@hazelnuter
Sep 12 2017 23:53
WHat???
@NeelDVirus what do you mean
Eric Miller
@ericmiller777
Sep 12 2017 23:56
how can i do a ifd statement for
if($("#status").html() == "Work"){
$("#status").html(Break);
hazelnuter
@hazelnuter
Sep 12 2017 23:57
idk
@ericmiller777 idk
Eric Miller
@ericmiller777
Sep 12 2017 23:58
its okay @hazelnuter thanks
CamperBot
@camperbot
Sep 12 2017 23:58
ericmiller777 sends brownie points to @hazelnuter :sparkles: :thumbsup: :sparkles:
:cookie: 7 | @hazelnuter |http://www.freecodecamp.com/hazelnuter
hazelnuter
@hazelnuter
Sep 12 2017 23:58
@ericmiller777 welcome sorry i coulnd not help
Eric Miller
@ericmiller777
Sep 12 2017 23:59
dont worry about it help who you can
hazelnuter
@hazelnuter
Sep 12 2017 23:59
@ericmiller777 thanks bye!
CamperBot
@camperbot
Sep 12 2017 23:59
hazelnuter sends brownie points to @ericmiller777 :sparkles: :thumbsup: :sparkles:
:cookie: 299 | @ericmiller777 |http://www.freecodecamp.com/ericmiller777