These are chat archives for FreeCodeCamp/Help

24th
Jul 2017
Eurikan So
@soerik
Jul 24 2017 00:14
how do u nest an i element in a button element(bootstrap)
korzo
@korzo
Jul 24 2017 00:17
@soerik <button><i></i></button>
Ygor Dantas
@ygordantas
Jul 24 2017 00:17

does anybody see what I am missing here ? I keep getting undefined. help plx

var arr=[];

function factorialize(num) {
for (var i=1; i<=num; i++){
arr.push(i); // [1,2,3,4,5]
}
arr.reduce(function (total, currentVal){
return total * currentVal;},0);
}

factorialize(5);

Moisés Man
@moigithub
Jul 24 2017 00:18
return the reduce result
also..remove the ,0 from ur reduce <-- that 2nd argument its the "initial value"
.. if u multiply values by 0... u get __
@ygordantas
Ygor Dantas
@ygordantas
Jul 24 2017 00:20
@moigithub I did returned 'return total * currentVal;},0);’ that 0 just means that has to start from the 0 element of the array in which this case is one
Moisés Man
@moigithub
Jul 24 2017 00:22
inside the reduce callback.. whatever u return will be the next value for "total" parameter
this new value will be used on the next calc
but the WHOLE reduce after finish iterating all the array.. return a "final value"
u not doing anything with that
0 its NOT the 0 element.. its the value for ur first parameter at first iteration...
its on the documentation.... mdn.io/array.reduce
Ygor Dantas
@ygordantas
Jul 24 2017 00:26

@moigithub you mean like this ‘

arr.reduce(function (total, currentVal){
result = total * currentVal;});
return result;
}'

I got NaN
Moisés Man
@moigithub
Jul 24 2017 00:27
u can easily check adding console.log
var finalResult = [1111,2222].reduce((a,b)=>{
   console.log("this is a ",a)
   console.log("this is b ",b)
   return 9999;
}, 0) //<--- initial value
shows ...
this is a 0
this is b 1111
this is a 9999 <-- return inside the callback will be next value for a
this is b 2222
there are few youtube videos .. if u dont understand the documentation explaining reduce
Ygor Dantas
@ygordantas
Jul 24 2017 00:32
Thx man I am trying to understand the logic here on my text editor.
Roman Mirov
@thecalicoder
Jul 24 2017 00:33

Hi guys! Can somebody help me with some C++?
Say you type in "hello world" as an input to

string s1="defaultString";
cin>>s1;

but later in the code is this

string s2="defaultString2";
cin>>s2;

How do I prevent s2 from reading the value of "world" from the first input? Is there a way to somehow "clear" the character input after the s1 is assigned a value?

Ygor Dantas
@ygordantas
Jul 24 2017 00:36
@moigithub thank you for the help
CamperBot
@camperbot
Jul 24 2017 00:36
ygordantas sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3529 | @moigithub |http://www.freecodecamp.com/moigithub
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 00:38
Can someone help me? Im having a hard time getting my nav tabs to go the right side of the page.
Roman Mirov
@thecalicoder
Jul 24 2017 00:39
@sjames1958gm But I'm getting the error "INT_MAX was not declared in this scope"
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 00:39
Also my tabs are not dropping down when I make the screen small.
Stephen James
@sjames1958gm
Jul 24 2017 00:40
@thecalicoder include climits ?
THis is the site I use for c++ http://www.cplusplus.com/reference/
Roman Mirov
@thecalicoder
Jul 24 2017 00:42
@sjames1958gm Ok it somewhat works but now when I type in the second input, pressing enter just gives me a newline and doesn't assign the first word as the value for s2
So I'm stuck on the input
Eric Miller
@ericmiller777
Jul 24 2017 00:45
should I use bootstrap 3 or 4?
github.com
Kyle Holm
@thekholm80
Jul 24 2017 00:50
@ericmiller777 bootstrap 3 is what FCC teaches
Roman Mirov
@thecalicoder
Jul 24 2017 00:53
YESSSSS! I found the solution. I had to place getline(cin, s1); right before string s2="defaultString2";
Reminds me of https://youtu.be/uBiY2fMeM1U?t=1m39s
Click the link not the play button inside (if you click the video here it will start at 0s with some profanity). Funniest clip I've ever seen.
Gregory Cheng
@gregorytcheng
Jul 24 2017 03:00
Would someone be able to look through my code and tell me why I’m only printing out the last element in my array? Can’t seem to figure this one out https://codepen.io/gregorytcheng/pen/OjLreB?editors=1010
My API works when logging it into the console, but keeps returning as “undefined” when I try to put it into html
korzo
@korzo
Jul 24 2017 03:03
@gregorytcheng Change for loop to this:
for (let i = 0; i < streamers.length; i++) {
Gregory Cheng
@gregorytcheng
Jul 24 2017 03:03
what does the “let” do? Never seen that in a for loop before
Ah I see, just looked it up online
@korzo thanks for the tip. Helping me out a lot recently lol
CamperBot
@camperbot
Jul 24 2017 03:04
gregorytcheng sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 294 | @korzo |http://www.freecodecamp.com/korzo
Corey Pennington
@JuiceyDuecy
Jul 24 2017 03:04
Yeah let is ES6 stuff
korzo
@korzo
Jul 24 2017 03:07
@gregorytcheng without let, i is always 8 when callback function of getJSON run
let is block scoped definition of variable and it's bind to current loop iteration
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 03:38
Do I have to use a certain site to upload images to codepen
?
To link*
korzo
@korzo
Jul 24 2017 03:40
@Scodavinci Maybe Dropbox, Google Drive, Github. Imgur doesn't work with codepen
Dean
@SupernaturalDean
Jul 24 2017 03:46
Where should I add a "font-size"?
Nitin Sahu
@globefire
Jul 24 2017 03:54

function destroyer(arr, n1, n2) {
  //                                                                                                                                            Remove all the values 
  //arr.filter(n1 || n2);
  for(var i =0; i < arr.length; i++){
    if(arr[i] === n1 || arr[i] === n2){
     // arr.pop(i);
      //delete arr[i];
      arr.pop(i);
    }
     }
  return arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);
what's wrong in this ?
Dean
@SupernaturalDean
Jul 24 2017 03:57

tyle>
.red-text {
color: red;
}
</style>

<h2 class="red-text">我家的猫咪</h2>

<p{ font-size: 16px; } class="red-text">在大家心目中,猫是慵懒的可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。</p>

heroiczero
@heroiczero
Jul 24 2017 03:59
@SupernaturalDean in CSS or < style> or in-line style
Dean
@SupernaturalDean
Jul 24 2017 04:07
Thanks.I got it
heroiczero
@heroiczero
Jul 24 2017 04:07
:+1:
Viktor Tiutiun
@vittorioVT
Jul 24 2017 04:44
hello everybody
heroiczero
@heroiczero
Jul 24 2017 04:45
@vittorioVT :wave: hello
mstellaluna
@mstellaluna
Jul 24 2017 04:45
@thekholm80 u online?
Viktor Tiutiun
@vittorioVT
Jul 24 2017 04:45
@heroiczero hi :smile:
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 05:35
Anyone there?
Viktor Tiutiun
@vittorioVT
Jul 24 2017 05:37
yes
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 05:39
I need help if you can
Im having a hard time getting my background image to work on my portfolio project https://codepen.io/scodavinci/pen/zdOdNY
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 05:45
@vittorioVT thank you
CamperBot
@camperbot
Jul 24 2017 05:45
scodavinci sends brownie points to @vittoriovt :sparkles: :thumbsup: :sparkles:
:cookie: 799 | @vittoriovt |http://www.freecodecamp.com/vittoriovt
Viktor Tiutiun
@vittorioVT
Jul 24 2017 05:46
@Scodavinci or you should put all your code in <div class="container bg"> ....</div>
.bg {
background-image: url("");
}
elad ben aderet
@eladonline
Jul 24 2017 05:49
i want to make a dropdown button on hover, but when hovered, the effect are not applying to any other element like div or body.
this is the code
.dropbtn:hover .dropdown-content {
  background: green ; //tried !important also not working
  display:block;
 }
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 05:49
It made my navigation bar shrink when I did that and tucked image behind nav bar
@vittorioVT
Viktor Tiutiun
@vittorioVT
Jul 24 2017 05:52
@Scodavinci you need grid(container, rows. columns)
@eladonline show please all code
Viktor Tiutiun
@vittorioVT
Jul 24 2017 05:57
@eladonline you need to connect Bootstrap in JS also,
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 05:57
hmm
elad ben aderet
@eladonline
Jul 24 2017 05:58
@vittorioVT why does it matter ?
Viktor Tiutiun
@vittorioVT
Jul 24 2017 05:58
@eladonline besides try to connect jQuery at first, then react
elad ben aderet
@eladonline
Jul 24 2017 05:58
@vittorioVT jquery not playing a roll here
@vittorioVT in my question i mean
Viktor Tiutiun
@vittorioVT
Jul 24 2017 05:59
@eladonline ok
elad ben aderet
@eladonline
Jul 24 2017 06:02
@vittorioVT what is it \
elad ben aderet
@eladonline
Jul 24 2017 06:07
@vittorioVT that looks good
@vittorioVT is another version of react ?
@vittorioVT ow i didnt know i can connect bootstrap to react
Viktor Tiutiun
@vittorioVT
Jul 24 2017 06:09
@eladonline no, just there is libraries work together from the bootstrap
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 06:09
@vittorioVT Ithink my problem got worse https://codepen.io/scodavinci/pen/zdOdNY
elad ben aderet
@eladonline
Jul 24 2017 06:10
ty
Viktor Tiutiun
@vittorioVT
Jul 24 2017 06:10
@eladonline welcome
Viktor Tiutiun
@vittorioVT
Jul 24 2017 06:18
@Scodavinci it's ok, on your page have nothing, if you add context, you will see that your background is stretched and on
@Scodavinci you can also return to the option with body
0Hamza
@0Hamza
Jul 24 2017 06:32
Good Morning Guys
I am new to freeCodeCamp and i hope you can help me with an issue i am having with
ES6: Write Higher Order Arrow Functions lesson challenge
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:34
@0Hamza Shoot
0Hamza
@0Hamza
Jul 24 2017 06:35
Thx
i am supposed to Use arrow function syntax to compute the square of only the positive integers (fractions are not integers) in the array realNumberArray and store the new array in the variable squaredIntegers.
any hints would be appreciated
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:38
@0Hamza To separate integers from floating point numbers (fractions) you can use number % 1 === 0
to check for positive intergers, you can do number % 1 === 0 && number > 0
then you will use Array.prototype.map on your realNumberArray
and you will pass a callback function (as an arrow function) to map. Where you will perform these checks and perform necessary action
0Hamza
@0Hamza
Jul 24 2017 06:49
Thank you
__mifflin__
@cdrainxv
Jul 24 2017 06:51
@0Hamza: You could also make use of isInteger method.
So filter out the the elements that are integers and are positive* and then map or forEach on the elements…
Darren
@DarrenfJ
Jul 24 2017 06:55
evening fCC
Santosh Vijapure
@santoshvijapure
Jul 24 2017 06:55
hey im stuck
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:55
Hi Stuck!
Santosh Vijapure
@santoshvijapure
Jul 24 2017 06:55
i need help
Viktor Tiutiun
@vittorioVT
Jul 24 2017 06:55
@DarrenfJ hi :smile:
Darren
@DarrenfJ
Jul 24 2017 06:55
@vittorioVT hey buddy :D
Santosh Vijapure
@santoshvijapure
Jul 24 2017 06:56
fuck i said im stuck somewhere :) lol
Darren
@DarrenfJ
Jul 24 2017 06:56
and noice one @SweetCodingInc "Hi stuck" snicker
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:56
:D
@santosh62 Then I would have said Hi Stuck somewhere :P
Santosh Vijapure
@santoshvijapure
Jul 24 2017 06:56
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  var result = "";
  // Your code below this line


  // Your code above this line
  return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
@SweetCodingInc uuuu ;)
i cant find how to solve this'
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:57
@santosh62 yeah.. so you need to concatenate all the arguments (myNoun, myAdjective, myVerb, myAdverb) to your result
Morchid Chellali
@Morched23MJ
Jul 24 2017 06:57
Anyone that uses Atom, can help me via PMS? I'm strugglin' lol ...
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:57
and make sure you concatenate with a space between each of them
@Morched23MJ PMS! That sounds wrong!
Santosh Vijapure
@santoshvijapure
Jul 24 2017 06:58
i tried but it didnt worked
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:58
@santosh62 What did you try so far?
Darren
@DarrenfJ
Jul 24 2017 06:58
@santosh62 just think of the ___'d the __ (the man walked the dog) etc etc..
Morchid Chellali
@Morched23MJ
Jul 24 2017 06:58
Private messages?
Darren
@DarrenfJ
Jul 24 2017 06:58
you are given everthing for the blanks.. add together to make it into a sentence
Morchid Chellali
@Morched23MJ
Jul 24 2017 06:58
@SweetCodingInc
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 06:59
Oh! I see.. I thought something else... Anyway.. I use VSCode... Not much fond of Atom
Morchid Chellali
@Morched23MJ
Jul 24 2017 06:59
Lol, alright.
Santosh Vijapure
@santoshvijapure
Jul 24 2017 06:59
result=""+''"+""+"";
like this??
Darren
@DarrenfJ
Jul 24 2017 06:59
@santosh62 which is what @SweetCodingInc is saying here "so you need to concatenate all the arguments (myNoun, myAdjective, myVerb, myAdverb) to your resultand make sure you concatenate with a space between each of them"
Viktor Tiutiun
@vittorioVT
Jul 24 2017 07:00
@santosh62 myNoun + " " + myAdjective....
Santosh Vijapure
@santoshvijapure
Jul 24 2017 07:00
i didnt get it
;(
Darren
@DarrenfJ
Jul 24 2017 07:00
@santosh62 more like result = [insert noun variable] + "some words to make a sentence" + etc etc
Santosh Vijapure
@santoshvijapure
Jul 24 2017 07:01
ohhk ill try it wait
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:01

I'd just do

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  return Array.prototype.join.call(arguments, ' ');
}

and be done with it :P

Darren
@DarrenfJ
Jul 24 2017 07:01
@santosh62 note also how @vittorioVT adds spaces in between them as well
Santosh Vijapure
@santoshvijapure
Jul 24 2017 07:01
@DarrenfJ yes got it
ty'
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:02
no guarantee that the resulting sentence will make a grammatical sense though
Darren
@DarrenfJ
Jul 24 2017 07:02

@SweetCodingInc ingenious ;)

I'd just do

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
  return Array.prototype.join.call(arguments, ' ');
}

and be done with it :P

Santosh Vijapure
@santoshvijapure
Jul 24 2017 07:03
@SweetCodingInc ty dude
CamperBot
@camperbot
Jul 24 2017 07:03
santosh62 sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 158 | @sweetcodinginc |http://www.freecodecamp.com/sweetcodinginc
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:03
@santosh62 :+1:
Santosh Vijapure
@santoshvijapure
Jul 24 2017 07:03
@SweetCodingInc ;)
Aleksandar B.
@aleksandar-b
Jul 24 2017 07:04
anyone fammiliar with redux?
Santosh Vijapure
@santoshvijapure
Jul 24 2017 07:04
naa'
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 07:05
@DarrenfJ :+1:
Darren
@DarrenfJ
Jul 24 2017 07:06
thanks @SweetCodingInc @vittorioVT on that one too :D
CamperBot
@camperbot
Jul 24 2017 07:06
darrenfj sends brownie points to @sweetcodinginc and @vittoriovt :sparkles: :thumbsup: :sparkles:
:cookie: 159 | @sweetcodinginc |http://www.freecodecamp.com/sweetcodinginc
:cookie: 800 | @vittoriovt |http://www.freecodecamp.com/vittoriovt
Claudio Restifo
@Marmiz
Jul 24 2017 07:14
@samosale what about it?
Aleksandar B.
@aleksandar-b
Jul 24 2017 07:17
@Marmiz nvm, I asked on main chat.... I was confused why would someone use combine reducers if in separate reducer you wont have access to different parts of state
Claudio Restifo
@Marmiz
Jul 24 2017 07:18
@samosale you got thing clearer?
Aleksandar B.
@aleksandar-b
Jul 24 2017 07:19
@Marmiz yes
KinderPreet Singh
@kindercappy
Jul 24 2017 07:19
Please checkout the Pomodoro clock i made.
Do report any bugs you find.
https://codepen.io/kindercappy/full/vJYyJa/
Claudio Restifo
@Marmiz
Jul 24 2017 07:19
:+1:
Viktor Tiutiun
@vittorioVT
Jul 24 2017 07:21
@DarrenfJ ty
CamperBot
@camperbot
Jul 24 2017 07:21
vittoriovt sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1928 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Jul 24 2017 07:23
@Marmiz buddy! welcome to the deserted island ;)
Claudio Restifo
@Marmiz
Jul 24 2017 07:26
:palm_tree:
Darren
@DarrenfJ
Jul 24 2017 07:26
@kindercappy looks good buddy.. like the flip numbers and the overall style.. note entirely sure what the second set of numbers does? Sets the seconds?
Claudio Restifo
@Marmiz
Jul 24 2017 07:26
@DarrenfJ you certainly notice the absence of the help button on the main UI
Darren
@DarrenfJ
Jul 24 2017 07:27
if so, it's not doing it for me
@Marmiz oh gawd yah been on some forum threads gnashing my teeth and lamenting the loss of the button
but alas.. to no avail sigh
KinderPreet Singh
@kindercappy
Jul 24 2017 07:29
@DarrenfJ thanks. 1stset is minutes and 2nd set is seconds
CamperBot
@camperbot
Jul 24 2017 07:29
kindercappy sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1929 | @darrenfj |http://www.freecodecamp.com/darrenfj
Claudio Restifo
@Marmiz
Jul 24 2017 07:30
for sure here is quite :D
I liked to interact with new coders, and I felt I made some connection with some of you "regulars"...
But with scalability in mind I see the point of removing the chat :)
Darren
@DarrenfJ
Jul 24 2017 07:30
@kindercappy ok.. whever i hit start it defaulted to the minutes with 00 for seconds
@Marmiz that you?
Claudio Restifo
@Marmiz
Jul 24 2017 07:31
@DarrenfJ ?
Darren
@DarrenfJ
Jul 24 2017 07:32
the quote...
@kindercappy a nice to have would be some way to quickly scroll through the numbers like if you hold the + down it increments at a continuous and slightly quicker pace.. but that' for later.. it will pass as is I think (even without the seconds working)
KinderPreet Singh
@kindercappy
Jul 24 2017 07:37
@DarrenfJ yes that would be convenient. :)
Darren
@DarrenfJ
Jul 24 2017 07:43
just adding 2 more cents to it ;)
ok sneaking off to watch coding vods... have fun. code on
and brownies to everyone volunteering to help out
thanks @Marmiz @vittorioVT @SweetCodingInc
CamperBot
@camperbot
Jul 24 2017 07:45
darrenfj sends brownie points to @marmiz and @vittoriovt and @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:warning: darrenfj already gave sweetcodinginc points
:warning: darrenfj already gave vittoriovt points
:star2: 1004 | @marmiz |http://www.freecodecamp.com/marmiz
Darren
@DarrenfJ
Jul 24 2017 07:45
later
Claudio Restifo
@Marmiz
Jul 24 2017 07:46
@DarrenfJ ty
CamperBot
@camperbot
Jul 24 2017 07:46
marmiz sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1930 | @darrenfj |http://www.freecodecamp.com/darrenfj
Adish Jain
@Adishjain58
Jul 24 2017 08:11
can anyone help me with https://www.freecodecamp.org/challenges/stand-in-line challenge
i have written the code and it is giving the output but my challenge is not clearing

function nextInLine(arr, item) {
// Your code here
testArr.push(item);
item=testArr.shift();
return item; // Change this line
}

// Test Setup
var testArr = [5,6,7,8,9];

// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(nextInLine(testArr, 1)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));

Claudio Restifo
@Marmiz
Jul 24 2017 08:12
@Adishjain58 you should not touch testArr, but instead work with whatever array is passed into the function
(if not sure, review function arguments)
Adish Jain
@Adishjain58
Jul 24 2017 08:13
but for output they are using testArr array
Claudio Restifo
@Marmiz
Jul 24 2017 08:14
@Adishjain58 doesn't matter the test output... they'll run many different one in the background
your function should use the arguments it recive
Adish Jain
@Adishjain58
Jul 24 2017 08:15
my code is giving output but they are not recognising it
Claudio Restifo
@Marmiz
Jul 24 2017 08:15
@Adishjain58 because the test is not expecting testArray to be touched
all you have to do is work with the proper varaible
Adish Jain
@Adishjain58
Jul 24 2017 08:16
so is hould create a new array and work on it?
*i should
Claudio Restifo
@Marmiz
Jul 24 2017 08:17
@Adishjain58 nope. You see that your function is accepting an arr argument?
that's the array you should modify
Adish Jain
@Adishjain58
Jul 24 2017 08:17
ok
Claudio Restifo
@Marmiz
Jul 24 2017 08:17
if not sure read about functions arguments
Adish Jain
@Adishjain58
Jul 24 2017 08:18
thnx @Marmiz
CamperBot
@camperbot
Jul 24 2017 08:18
adishjain58 sends brownie points to @marmiz :sparkles: :thumbsup: :sparkles:
:star2: 1005 | @marmiz |http://www.freecodecamp.com/marmiz
Claudio Restifo
@Marmiz
Jul 24 2017 08:21
@Adishjain58 just to clarify.
function example(item) {
 return testItem
}

// Test Setup
var testItem = 1

// in this example the function changes the testItem global variable, so doesn't matter which value I pass to it, it will always give back 1
example(13) // 1
example(7) // 1
example('a string') // 1
Eric Miller
@ericmiller777
Jul 24 2017 09:35
hey guys trying to start using visual studio code
<script>$(document).ready(function() {
$("#topText").addClass("animated fadeOut")
});</script>
why does that not work?
in head i have
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
Stephen James
@sjames1958gm
Jul 24 2017 09:46
@ericmiller777 how are you 'running' the code?
Eric Miller
@ericmiller777
Jul 24 2017 09:47
just launching it in github pages?
well copying it*
Stephen James
@sjames1958gm
Jul 24 2017 09:50
@ericmiller777 There is an error in the devtools console about bootstrap needing jquery, maybe load bootstrap js after jquery js
Eric Miller
@ericmiller777
Jul 24 2017 09:51
okay
@sjames1958gm pushed that
Stephen James
@sjames1958gm
Jul 24 2017 09:55
Where are the classes animated and fadeOut defined?
Eric Miller
@ericmiller777
Jul 24 2017 09:56
.>
@sjames1958gm I thought they are part of jQuery >.>;
wonder
@wonder2991
Jul 24 2017 09:57
i think they are part of animated css
Eric Miller
@ericmiller777
Jul 24 2017 09:57
ah think
yes
Stephen James
@sjames1958gm
Jul 24 2017 09:58
@ericmiller777 I didn't think jquery had any css in the base libraries
__mifflin__
@cdrainxv
Jul 24 2017 09:58
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
Or get it from npm
Eric Miller
@ericmiller777
Jul 24 2017 09:59
@sjames thanks
CamperBot
@camperbot
Jul 24 2017 09:59
ericmiller777 sends brownie points to @sjames :sparkles: :thumbsup: :sparkles:
:warning: @sjames's account is not linked with freeCodeCamp. Please visit the settings and link your GitHub account.
Eric Miller
@ericmiller777
Jul 24 2017 09:59
@cdrainxv thanks
AdamCS
@csikos3d
Jul 24 2017 10:33
hi, would You please someone help me? I have two questions about my half-ready quote machine challenge.
  1. Why my margin-top at #sharetext in css moving the Quotes itself with the text id? they are not including each other. I am not sure about their relation ship.
  2. How can I "stick" the share buttons to the main-box. for now if I resize they are going beneath the main-box. (i am not using bootstrap for now).
    thank You!
    https://codepen.io/csikos/pen/OgGbRp?editors=1100
Victor Popescu
@VicPopescu
Jul 24 2017 11:13
@csikos3d I can't find #sharetext
AdamCS
@csikos3d
Jul 24 2017 11:32
@VicPopescu it starts in the 128. row in the css
IggySmith
@IggySmith
Jul 24 2017 11:38
image.png
help please, i am trying to position the pink div in the middle of the orange div (which i know is 50% both ways), but since it is the second child of the div, how do i position it relative to the orange div when i have already made the orange div relative to the light blue one??
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:39
assuming you have explicitly give width to your orange div, just set margin: auto; on your orange div
@IggySmith
Dean
@SupernaturalDean
Jul 24 2017 11:45
blob
How should I use the "#"
IggySmith
@IggySmith
Jul 24 2017 11:49
@SweetCodingInc i have given width of the orange div as percentage of light blue div.. your solution doesn't seem to work
image.png
AdamCS
@csikos3d
Jul 24 2017 11:49
@SupernaturalDean replace the link itself with the #
IggySmith
@IggySmith
Jul 24 2017 11:50

real question though i guess is this.

You are able to position one div relative to another by making the parent relative and child absolute.

but then how do you position a second child but this time relative to the first?

Dean
@SupernaturalDean
Jul 24 2017 11:51
Thnx
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:54
@IggySmith you have codepen for this?
IggySmith
@IggySmith
Jul 24 2017 11:55
no, but if your willing to help, i can put it in lol
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:56
@IggySmith please do
IggySmith
@IggySmith
Jul 24 2017 11:57
@SweetCodingInc thanks
CamperBot
@camperbot
Jul 24 2017 11:57
iggysmith sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 161 | @sweetcodinginc |http://www.freecodecamp.com/sweetcodinginc
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 11:59
@IggySmith Would it be okay if I change your markup structure a little?
This part position: absolute; is really bad!
IggySmith
@IggySmith
Jul 24 2017 11:59
yes @SweetCodingInc
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 12:00
Alright.. give me a few mins
IggySmith
@IggySmith
Jul 24 2017 12:08
also why is position: absolute; bad?
don't we (I) want the head to stay in the same position ?
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 12:20
@IggySmith I've made some changes... This is preliminary structure... Let me know if you need any changes
also why is position: absolute; bad?
that's because it takes the absolutely positioned element outside of natural flow of element rendering
and there are many ways to make something stay in same position than position: absolute
as a rule of thumb, try positioning your elements using padding/margin and display properties.
to ensure proper responsiveness
IggySmith
@IggySmith
Jul 24 2017 12:24
@SweetCodingInc thank you very much..
CamperBot
@camperbot
Jul 24 2017 12:24
iggysmith sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:warning: iggysmith already gave sweetcodinginc points
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 12:27
@IggySmith :+1:
IggySmith
@IggySmith
Jul 24 2017 12:28
@SweetCodingInc .navigationButt > div { display: block; } means i dont have to define each child div as a block right
Sweet Coding :)
@SweetCodingInc
Jul 24 2017 12:31
Partially yes...
what it really means is set all divs to display: block that are immediate children ( > ) of .navigationButt
and if it's a div, then you don;t have to explicitly set display: block becuase divs are by default block
Eric Weiss
@eweiss17
Jul 24 2017 12:38
position absolute makes me cry :cry:
IggySmith
@IggySmith
Jul 24 2017 12:49
@eweiss17 lol
xsf
@allan2coder
Jul 24 2017 13:02
HELLO
Ken Haduch
@khaduch
Jul 24 2017 13:26
@allan2coder - hello to you, too.
Kyle Holm
@thekholm80
Jul 24 2017 13:30
@mstellaluna i'm here now if you still needed me
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:35
@thekholm80 May kittens devour your polynomial soul
Kyle Holm
@thekholm80
Jul 24 2017 13:35
@diomed you're on my bad list
do all the electron things
dang it
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:36
O.o
how so?
._.
Kyle Holm
@thekholm80
Jul 24 2017 13:36
electron is so very cool lol
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:36
yay :+1:
so how did I get on the bad list then?
Kyle Holm
@thekholm80
Jul 24 2017 13:36
I had nearly stopped writing code and here you come giving me more homework
so close to being out
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:37
haha!
don't stop believing
Kyle Holm
@thekholm80
Jul 24 2017 13:37
and i'm joking about the bad list
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:37
I mean .... coding
@thekholm80 I+m safe as long as I'm not on Arya's bad list :yum:
Kyle Holm
@thekholm80
Jul 24 2017 13:41
what is an Arya?
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:41
you mean who
Arya Stark
Kyle Holm
@thekholm80
Jul 24 2017 13:42
the little one? Maise Whatsherface?
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:43
yes
lil killer 1
Kyle Holm
@thekholm80
Jul 24 2017 13:43
I stopped watching in Season 2
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:43
and started coding, I presume
hence ... u so advanced
Kyle Holm
@thekholm80
Jul 24 2017 13:44
nah, that was like 8 years ago wasn't it?
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:46
wow. time sure flies when u live
Eric Weiss
@eweiss17
Jul 24 2017 13:46
i bet it flies even faster when u dead
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:47
u sure know how to tempt a man
Kyle Holm
@thekholm80
Jul 24 2017 13:47
that's pretty dark
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:48
darkness envelops me
maybe it even develops me
Eric Weiss
@eweiss17
Jul 24 2017 13:49
do you make code that bugs me
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:49
yes.
always. all the time. I'm your guy for that
@eweiss17 here's my latest attempt tootsuite/mastodon#4183
somehow
:smiling_imp:
Eric Weiss
@eweiss17
Jul 24 2017 13:53
I don't know that language
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:54
that's the language of my people
Kyle Holm
@thekholm80
Jul 24 2017 13:55
it has conflicts (somehow)
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:56
@thekholm80 can I fix conflicts (somehow)
Eric Weiss
@eweiss17
Jul 24 2017 13:56
gotta know english to internet. tsk tsk
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:57
by only downloading that file
Kyle Holm
@thekholm80
Jul 24 2017 13:57
i'm not sure
do you know what the conflict is?
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:58
yea. I translated first, then I forgot, then I remembered, then translated again, hence conflicts
coz my translations are inconsistent
Kyle Holm
@thekholm80
Jul 24 2017 13:59
oh, so there are too many commits?
May Kittens Devour Your Soul
@diomed
Jul 24 2017 13:59
there are 2 different commits
from yours truly, of course :yum:
Eric Weiss
@eweiss17
Jul 24 2017 14:00
clearly you need to do a merge
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:00
can I do that somehow online
or do I need do download bloody everything?
for just that 1 file to change
Kyle Holm
@thekholm80
Jul 24 2017 14:01
he can't merge, someone with merge rights has to do it and it's not been approved because there are conflicts. unless i'm reading all that wrong
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:02
yes, u're right @thekholm80
Kyle Holm
@thekholm80
Jul 24 2017 14:02
have you tried giving up?
that's my go-to
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:03
I never did anything by giving up
Kyle Holm
@thekholm80
Jul 24 2017 14:03
pfft and you never will with that attitude
:grin:
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:04
I did try giving up JS. so far so good
Kyle Holm
@thekholm80
Jul 24 2017 14:07
JS is fun though
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:09
In a way I can't imagine :sob:
Kyle Holm
@thekholm80
Jul 24 2017 14:09
i bet you could master it if you wanted to
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:10
it's like i'd lhave to learn english for js, then js
:sob:
Eric Weiss
@eweiss17
Jul 24 2017 14:10
you clearly already know english?
Kyle Holm
@thekholm80
Jul 24 2017 14:10
you speak english better than I do
and english is the only language i know
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:11
@eweiss17 I don't know technical english
only conversational
Eric Weiss
@eweiss17
Jul 24 2017 14:12
only memes? lol sorry
Kyle Holm
@thekholm80
Jul 24 2017 14:12
isn't there a croatian js?
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:12
@eweiss17 haha yes . and no you're not sorry :yum:
Eric Weiss
@eweiss17
Jul 24 2017 14:12
any programming language, even for native language speakers, can look like a foreign language as the terms are not used in common place
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:13
@thekholm80 last time anyone ever translated anything to Croatian was probably in 90es
Kyle Holm
@thekholm80
Jul 24 2017 14:14
i saw some guy on github trying to translate something to Croatian. there were conflicts (somehow)
May Kittens Devour Your Soul
@diomed
Jul 24 2017 14:14
:smile: :yum:
clearly he doesn't know what he's doing
poor bastard
Kyle Holm
@thekholm80
Jul 24 2017 14:15
lol
Momozor
@momozor
Jul 24 2017 14:18
hello
Kyle Holm
@thekholm80
Jul 24 2017 14:18
@faraco :wave:
Momozor
@momozor
Jul 24 2017 14:19
heyy :D
Eric Weiss
@eweiss17
Jul 24 2017 14:26
man codepen pro is like $9 for a month. thats a bit much
Kyle Holm
@thekholm80
Jul 24 2017 14:26
i'll let you come to my house and write your code here for $8 a month
I have air conditioning, that's way better than codepen
Momozor
@momozor
Jul 24 2017 14:28
$9? Damn, I rather use that to rent 2 DO instances.
Abdullah Ali
@aali21
Jul 24 2017 14:37
Guys, I dont know what to do this is really confusing
image.png
Eric Weiss
@eweiss17
Jul 24 2017 14:40
Well your var is called myVar not loc = myVar.... myVar is not defined
The point of the lesson is that you should be getting an error because variables declared inside functions are only avaliable for use inside the function
Momozor
@momozor
Jul 24 2017 14:43
so the difference between var scope only applies in a function block, where let ("use strict") applies to any block scope (for, function, if, and even naked { my_code })?
@eweiss17
Eric Weiss
@eweiss17
Jul 24 2017 14:45
screenshot does not mention let
Momozor
@momozor
Jul 24 2017 14:46
yes it doesn't, I'm asking off-challenge question.
Eric Weiss
@eweiss17
Jul 24 2017 14:46
you are asking me a question or telling me an answer?
Momozor
@momozor
Jul 24 2017 14:47
yes it doesn't, I'm asking off-challenge question.
what does both differs?
Bryan Reese
@breese8009
Jul 24 2017 14:48
@aali21 u cant access myVar outside that function
@aali21 and that function looks to be writtin wrong
Eric Weiss
@eweiss17
Jul 24 2017 14:49
I never really use let, but this is from MDN
let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used. This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.
Bryan Reese
@breese8009
Jul 24 2017 14:49
should drop var for let
Eric Weiss
@eweiss17
Jul 24 2017 14:50
saves memory?
Bryan Reese
@breese8009
Jul 24 2017 14:51
no, just no need for var
Eric Weiss
@eweiss17
Jul 24 2017 14:51
then no need for let?
if no explanation
Bryan Reese
@breese8009
Jul 24 2017 14:52
cause block scoping
but do as u please
Eric Weiss
@eweiss17
Jul 24 2017 14:53
in some scenarios var is better and some let is better. are you suggesting to never use var or sometimes use var?
Momozor
@momozor
Jul 24 2017 14:54
Hey thanks, now I see why let should be used -
{ var heh = "saym"; }

heh; // "saym"

{ let meh= "saym"; }

meh; // undefined reference
Bryan Reese
@breese8009
Jul 24 2017 14:54
@eweiss17 The point is, let avoids a source of misunderstanding, esp. for programmers with expectations set by languages with block-scope. A var has function scope (it declares a variable that's visible throughout the function) even though it looks like it has block scope.
var might possibly still be useful in an extreme case like machine-generated code, but I'm stretching hard there.
Momozor
@momozor
Jul 24 2017 14:55
ty @breese8009
CamperBot
@camperbot
Jul 24 2017 14:55
faraco sends brownie points to @breese8009 :sparkles: :thumbsup: :sparkles:
:cookie: 803 | @breese8009 |http://www.freecodecamp.com/breese8009
Kyle Holm
@thekholm80
Jul 24 2017 14:55
i don't recall the last time i wrote var
Bryan Reese
@breese8009
Jul 24 2017 14:55
^^
Kyle Holm
@thekholm80
Jul 24 2017 14:55
99% of my variables are const and let for the rest
Bryan Reese
@breese8009
Jul 24 2017 14:56
@eweiss17 welcome to es6
Momozor
@momozor
Jul 24 2017 14:56
sounds Ecmascript 2015 and newer are lexically scoped.
Eric Weiss
@eweiss17
Jul 24 2017 14:57
gee i guess i'm uber bad for using var, you caught me
Kyle Holm
@thekholm80
Jul 24 2017 14:57
it's not bad, just less optimal
Bryan Reese
@breese8009
Jul 24 2017 14:57
I never said it was bad
I didnt catch anything, u asked
i answered
Eric Weiss
@eweiss17
Jul 24 2017 14:59
i wasn't even the one asking it was faraco
Bryan Reese
@breese8009
Jul 24 2017 15:00
ok? lol u werent questioning me at all on it?
thats what i was responding to
Eric Weiss
@eweiss17
Jul 24 2017 15:02
i was trying to respond to faraco
Bryan Reese
@breese8009
Jul 24 2017 15:02
right on, sorry for responding to u
Eric Weiss
@eweiss17
Jul 24 2017 15:03
i'll use the @ more frequently, i find it annoying responding to ever message with that
Momozor
@momozor
Jul 24 2017 15:04
Okay can you guys stop arguing about 'who and which respond and ask' ? We are clearly sharing knowledge with each other. :)
Bryan Reese
@breese8009
Jul 24 2017 15:04
arguing ?
Eric Weiss
@eweiss17
Jul 24 2017 15:04
clearly you should read what that guy was telling me @faraco
Bryan Reese
@breese8009
Jul 24 2017 15:05
clarifying isnt arguing
troncarter
@troncarter
Jul 24 2017 15:06
For the section on React, is it React Native?
Momozor
@momozor
Jul 24 2017 15:06
I'm done. This is getting somewhere else that I don't want to see. Also thanks @eweiss17 for quoting the MDN's.
CamperBot
@camperbot
Jul 24 2017 15:06
faraco sends brownie points to @eweiss17 :sparkles: :thumbsup: :sparkles:
:cookie: 556 | @eweiss17 |http://www.freecodecamp.com/eweiss17
Kyle Holm
@thekholm80
Jul 24 2017 15:06
@troncarter no, this is web development not native apps
but a lot will be the same
Momozor
@momozor
Jul 24 2017 15:08
@thekholm80 what are you working on? and your roguelike dungeon is cool! May I use it for my personal projects? You don't have any LICENSE, so I assume your's propietary.
Kyle Holm
@thekholm80
Jul 24 2017 15:09
@faraco i've been working on getting react working in electron
and of course you can fork my dungeon, go nuts
Momozor
@momozor
Jul 24 2017 15:10
oh doing native now?
Kyle Holm
@thekholm80
Jul 24 2017 15:10
desktop apps
Margaret
@Margaret2
Jul 24 2017 15:11
@thekholm80 good morning :sunny:
Kyle Holm
@thekholm80
Jul 24 2017 15:11
@Margaret2 hiya! good morning to you
GeorgeII
@GeorgeII
Jul 24 2017 15:12
I ended up my calculator. Could you notice me if you find any bug? Just take a monkey test https://codepen.io/GeorgeIV/full/YxKeJB/
Stephen James
@sjames1958gm
Jul 24 2017 15:22
@GeorgeII Looks pretty good to me didn't see any bugs.
Martin Schmidt
@martuking
Jul 24 2017 15:24
hi everybody here
im having a problem with the backend tutorial, im working with npm node.js doing the challenge how-to-npm
someone has done this? im stuck in the outdated section, i have a special kind of error that i can´t resolve
Kyle Holm
@thekholm80
Jul 24 2017 15:27
@faraco i added a license on the repo to clear any confusion
GeorgeII
@GeorgeII
Jul 24 2017 15:31
@sjames1958gm ok ty
CamperBot
@camperbot
Jul 24 2017 15:31
:star2: 8145 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
georgeii sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
GeorgeII
@GeorgeII
Jul 24 2017 15:32
btm does freecodecamp have PHP tutorial?
Eric Weiss
@eweiss17
Jul 24 2017 15:34
codecademy does
Sydney
@SydneyWarren
Jul 24 2017 15:47
can anyone explain to me how the reduce method works, i tried reading on mozilla and watching a youtube video on it but i just dont get it... from the little i understand it almost works as a for loop?
Krishna Biradar
@kr5hn4
Jul 24 2017 15:48
@SydneyWarren The reduce() method reduces the array to a single value.
Sydney
@SydneyWarren
Jul 24 2017 15:50
function uniteUnique(arr) {
  arr = arr.reduce(function(sum, arr){
    return sum + arr;
  }, 0)
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Eric Weiss
@eweiss17
Jul 24 2017 15:50
what is the answer to that?
Sydney
@SydneyWarren
Jul 24 2017 15:50
@kr5hn4 ok and it takes back function as its parameters right
Eric Weiss
@eweiss17
Jul 24 2017 15:50
is it 18?
Sydney
@SydneyWarren
Jul 24 2017 15:50
@eweiss17 i didn't know what i was doing it return 6
i dont understand how to use this method
the answer i need is [1, 3, 2, 5, 4]
Eric Weiss
@eweiss17
Jul 24 2017 15:51
oh unite unique
Krishna Biradar
@kr5hn4
Jul 24 2017 15:52
@SydneyWarren yes it takes a function as an argument and applies that to every element in array and also an accumulator,.
Sydney
@SydneyWarren
Jul 24 2017 15:52
whats an accumulator?
Eric Weiss
@eweiss17
Jul 24 2017 15:52
it is in the mdn documentation
Pethaf
@Pethaf
Jul 24 2017 15:53
A bin that carries the result.
Krishna Biradar
@kr5hn4
Jul 24 2017 15:53
reduce() is meant to take an entire array and convert that entire array to a single value
Eric Weiss
@eweiss17
Jul 24 2017 15:53
accumulator
The accumulator accumulates the callback's return values; it is the accumulated value previously returned in the last invocation of the callback, or initialValue, if supplied (see below).
troncarter
@troncarter
Jul 24 2017 15:53
What are differences between reactjs and React native? Aside from the obvious
Sydney
@SydneyWarren
Jul 24 2017 15:53
ok and the accumulator is the second parameter right
Krishna Biradar
@kr5hn4
Jul 24 2017 15:54
No @SydneyWarren its the first parameter
cowCrazy
@cowCrazy
Jul 24 2017 15:55
@SydneyWarren first argument, but can also be initiated as a value for the first iteration
Sydney
@SydneyWarren
Jul 24 2017 15:56
arr.reduce(function (sum,arr) { } so function is the accumulator?
or is sum?
Krishna Biradar
@kr5hn4
Jul 24 2017 15:56
this diagram kinda helped me grasp the functions map() and reduce() when i was first learning them
https://cdn-images-1.medium.com/max/1600/1*cYZzHVWPO5pT6iMfcTHWXg.png
Eric Weiss
@eweiss17
Jul 24 2017 15:57
if you check on that page the "
Counting instances of values in an object" is probably something similar to what you want
cowCrazy
@cowCrazy
Jul 24 2017 15:58
var arraySingleValue = array.reduce(
  function (
    accumulator,
    currentValue,
    currentIndex,
    array
  ) {
    return accumulator + currentValue;
  }, initialAccumulator
);
@SydneyWarren
Sydney
@SydneyWarren
Jul 24 2017 15:59
@cowCrazy ok what's currentIndex and array there for?
Eric Weiss
@eweiss17
Jul 24 2017 16:00
currentIndex
The index of the current element being processed in the array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.
array
The array reduce was called upon.
Sydney
@SydneyWarren
Jul 24 2017 16:01
ok let me try to put it to use
Sydney
@SydneyWarren
Jul 24 2017 16:06
function uniteUnique(arr) {
  arr = arr.reduce(function(accum, arr){
    return accum + arr;
  } ,0)
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
i dont even know what i'm suppose to be doing
i'm guessing it's suppose to be setup at 0 why would i need it higher, yea i just dont understand this thing
cowCrazy
@cowCrazy
Jul 24 2017 16:11
@SydneyWarren look here is that what you expect accum and arr to be?
@SydneyWarren open the broweser console before you click run
Eric Weiss
@eweiss17
Jul 24 2017 16:12
why are you doing addition?
Sydney
@SydneyWarren
Jul 24 2017 16:14
no that's not what i expected i dont want addition, i want it to add the value into one array but not to repeat the value twice
can someone give me a clue where i should be going... it's not a simple as switching the + to a -, but i dont know
cowCrazy
@cowCrazy
Jul 24 2017 16:16
take a look again, I have added all the arguments, now you should choose those you want to work with
Krishna Biradar
@kr5hn4
Jul 24 2017 16:18
@SydneyWarren MDN would be the best place, but if you find mdn confusing, let us know what is the end result you are expecting so that we can help you better. You can also have a look at this explanation https://stackoverflow.com/questions/34600900/javascript-examples-of-reduce-function and see if you understand it.
Sydney
@SydneyWarren
Jul 24 2017 16:20
@cowCrazy ok in the first one i like arr
but i still need the numbers 5 and 4 after
Adebayo olamijin
@olamijinadebayo
Jul 24 2017 16:22
how do i make a function print on dev console
Krishna Biradar
@kr5hn4
Jul 24 2017 16:23
@olamijinadebayo console.log('print something to the console')
cowCrazy
@cowCrazy
Jul 24 2017 16:23
@SydneyWarren take the initialAccumulator as [], now each currVal is an array, so you should check for each of the element inside the inner array if they already present in the accumulator, if yes skip it, if not push it to the accumulator
Sydney
@SydneyWarren
Jul 24 2017 16:24
@cowCrazy ok
cowCrazy
@cowCrazy
Jul 24 2017 16:25
@SydneyWarren in the end after the if/else statment remember to return the accumulator, so you have its value to check against in the next iteration
sorry have to go, hope it would work :)
Sydney
@SydneyWarren
Jul 24 2017 16:25
@cowCrazy ok thanks
CamperBot
@camperbot
Jul 24 2017 16:25
sydneywarren sends brownie points to @cowcrazy :sparkles: :thumbsup: :sparkles:
:cookie: 306 | @cowcrazy |http://www.freecodecamp.com/cowcrazy
Adebayo olamijin
@olamijinadebayo
Jul 24 2017 16:27
@kr5hn4 i tried this function reusableFunction() {
console.log("Hi, World");
}
reusableFunction();
but its still not working
Shyamli Arora
@CiaoShyamli
Jul 24 2017 16:27
hey guys just help me out ,i don't understand the problem that it is not loading the online and offline peoplehttps://codepen.io/Aakshi/pen/WOVPrb?editors=0010
what is the problem i dont understand
Krishna Biradar
@kr5hn4
Jul 24 2017 16:29
@olamijinadebayo you need to open your browser dev console to see the output, have you done that?
Adebayo olamijin
@olamijinadebayo
Jul 24 2017 16:31
@kr5hn4 no is that necessary since its the challenge am trying to solve
Krishna Biradar
@kr5hn4
Jul 24 2017 16:33
No, its not necessary, but if you would like to see the output that's how you do it
Krishna Biradar
@kr5hn4
Jul 24 2017 16:40
@CiaoShyamli line 42 should have been $("#followerInfo") not $("#followingInfo")
sorry its on line 40
Shyamli Arora
@CiaoShyamli
Jul 24 2017 16:43
thank-you so much
Krishna Biradar
@kr5hn4
Jul 24 2017 16:44
also similarly on line 63 @CiaoShyamli
Yash Bhardwaj
@imyashbhardwaj
Jul 24 2017 16:45
free code camp output window of javascript gives me error that octal literals not allowed in strict mode
the code:

function binaryAgent(str) {
str=str.split("");
//for(var i=0;i<str.length;i++)
return parseInt(01000001,2);
}

binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111");

blob
does anyone know about this???
blob
GeorgeII
@GeorgeII
Jul 24 2017 16:55
@imyashbhardwaj I think you have to make like this return parseInt('0110110', 2);
the first argument should be string
Stephen James
@sjames1958gm
Jul 24 2017 17:04
@imyashbhardwaj numbers that start with a zero are considered octal literals. - @GeorgeII is correct that needs to be a string.
@CiaoShyamli Line 52 has i should be j url:"https://api.twitch.tv/kraken/streams/"+ deletedFollowers[i], <<<
@olamijinadebayo No comma in "Hi World"
Adebayo olamijin
@olamijinadebayo
Jul 24 2017 17:09
@sjames1958gm thanks man succesfully passed d challenge
CamperBot
@camperbot
Jul 24 2017 17:09
olamijinadebayo sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8146 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Tina Breaton
@TinaBreaton
Jul 24 2017 17:28
Can someone tell me if it's necessary to complete the FreeCodeCamp challenges using CodePen.io? I've been using Brackets and hosting my code on my Github account. Can I provide a link to my Github account or my own personal website when I submit my challenge to move onto the next step of FCC?
Kyle Holm
@thekholm80
Jul 24 2017 17:32
@TinaBreaton that is fine. I'm trying to locate the specific spot on the FCC website where they say it's allowed, might take some searching
Eric Weiss
@eweiss17
Jul 24 2017 17:32
you could always just copy/paste it into code pen just to submit if nothing else
it says As long as your code is publicly viewable, and you have a live demo, you can use whatever you want.
Kyle Holm
@thekholm80
Jul 24 2017 17:34
Do I have to use CodePen for the front end projects?
As long as your code is publicly viewable, and you have a live demo, you can use whatever you want.
Tina Breaton
@TinaBreaton
Jul 24 2017 17:47
Ah, thank you @thekholm80, @eweiss17 and @kr5hn4 ! The first project was fine to do in CodePen where I could copy and paste my code, but the other projects I'm working on had the addition of images that I had stored locally, and I couldn't find a way to import them into CodePen without upgrading to the PRO version to use the assets feature. Thanks again!
CamperBot
@camperbot
Jul 24 2017 17:47
tinabreaton sends brownie points to @thekholm80 and @eweiss17 and @kr5hn4 :sparkles: :thumbsup: :sparkles:
:cookie: 557 | @eweiss17 |http://www.freecodecamp.com/eweiss17
:star2: 1364 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:cookie: 238 | @kr5hn4 |http://www.freecodecamp.com/kr5hn4
Kyle Holm
@thekholm80
Jul 24 2017 17:47
@TinaBreaton yeah, handing images in codepen isn't fun. happy to help
Tina Breaton
@TinaBreaton
Jul 24 2017 17:49
:-)
Eric Weiss
@eweiss17
Jul 24 2017 17:50
I enjoy codepen for its ease of using preprocessors
Kyle Holm
@thekholm80
Jul 24 2017 17:50
i use codepen a lot when i need to quickly figure something out
Eric Weiss
@eweiss17
Jul 24 2017 17:51
It's also easy to just paste into this chat so people can view it
Kyle Holm
@thekholm80
Jul 24 2017 17:51
pretty much all of what i do now can't be done in codepen, so i'm glad i learned to develop locally
but codepen is still useful
Sydney
@SydneyWarren
Jul 24 2017 17:54
function uniteUnique(arr) {
  var newArr = arr.reduce(function(accum, currVal, currInd, arr){
      console.log("accum: " + accum);
    console.log("currVal: " + currVal);
    console.log("currInd: " + currInd);
    console.log("arr: " + arr);
  } , [])
  console.log("newArr in the end: " + newArr);
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
how come is doesn't iterate through [5, 2, 1, 4] or [2, 1] do i need it to i wanna return [1, 3, 2, 5, 4]
Coy Sanders
@coymeetsworld
Jul 24 2017 17:57
only 1 argument is specified for uniteUnique, so arr will be the first parameter passed, i.e. [1,3,2]
why do they make this challenge so complicated the more i ask questions the more confused i get
Mohamed Nabil Ayoub
@MohNabil
Jul 24 2017 18:02
Hi campers,I wanted to ask about the JSON API and Ajax part in the front end section,there is not enough explanation for that api's how it works just giving you the code and you write it or copy it in the editor I didn't understand much from that is there advice for that issue.
Levyian
@levyian
Jul 24 2017 18:02
@SydneyWarren you can get the additional arguments with using arguments. Find the number of arguments passed with an array and arguments.length.
Coy Sanders
@coymeetsworld
Jul 24 2017 18:03
@SydneyWarren have you tried looking at the link they provided regarding arguments? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments
Sydney
@SydneyWarren
Jul 24 2017 18:04
@levyian sorry everything is sounding foreign to me, so i'm not even on the right path to understanding how to use this reduce method. i have to go back and figure out how to include the other parts of uniteUnique using arguments is what i got from that
Levyian
@levyian
Jul 24 2017 18:04
@SydneyWarren yes, that would be correct.
Bryan Reese
@breese8009
Jul 24 2017 18:33
@SydneyWarren all its askin to do is concat all arrays and remove duplicates.
@SydneyWarren it gives ver confusing directions for sure
very*
Sydney
@SydneyWarren
Jul 24 2017 18:34
@breese8009 so i dont have to use reduce method
Bryan Reese
@breese8009
Jul 24 2017 18:34
@SydneyWarren it would be easier to, I like using reduce to concat arrays
especially array of arrays
Sydney
@SydneyWarren
Jul 24 2017 18:35
oh ok
Bryan Reese
@breese8009
Jul 24 2017 18:35
do u kno how to do that?
Sydney
@SydneyWarren
Jul 24 2017 18:35
nope
i'm trying to understand but there's no many things in the parameters its confusing
function uniteUnique(arr) {

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

var newArr = arr.reduce(function(accum, currVal, currInd, arr){
      console.log("accum: " + accum);
    console.log("currVal: " + currVal);
    console.log("currInd: " + currInd);
    console.log("arr: " + arr);
    return accum += currVal + ", ";
  } , [])
  console.log("newArr in the end: " + newArr);
}
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Bryan Reese
@breese8009
Jul 24 2017 18:36
u gotta ur arguments object an grab all arguments
@SydneyWarren u can also do this to grab all args
function uniteUnique(...arr){}
or just let args = Array.from(arguments)
function uniteUnique(...arr) {

 return arr; //[ [ 1, 3, 2 ], [ 5, 2, 1, 4 ], [ 2, 1 ] ]
}

uniteUnique([1, 3, 2], [5, 2, 1, 4], [2, 1]);
Bryan Reese
@breese8009
Jul 24 2017 18:41
then concat the array however u would like
then remove duplicates
and ur set :+1:
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 18:59
Can someone please help me on splitting my content onto a 3 page layout for my tabs to fit on one screen? https://codepen.io/scodavinci/pen/zdOdNY
cowCrazy
@cowCrazy
Jul 24 2017 19:47
@SydneyWarren hi, have you managed with it in the end or do you still need help?
Sydney
@SydneyWarren
Jul 24 2017 19:47
@cowCrazy just sat back down still trying to figure it out
dyon3334
@dyon3334
Jul 24 2017 20:37
javascript: switch vs if ?
Kyle Holm
@thekholm80
Jul 24 2017 20:37
is this a "who would win" question?
Coy Sanders
@coymeetsworld
Jul 24 2017 20:41
you're going to need to elaborate just a little bit more @dyon3334
aRtoo
@artoodeeto
Jul 24 2017 20:47
hi guys do you really need API key for twitch? the documentation is different now.
Kyle Holm
@thekholm80
Jul 24 2017 20:47
there's a FCC specific twitch api
image.png
number 9 in the project instructions
Coy Sanders
@coymeetsworld
Jul 24 2017 20:48
he asked the same question in at least 4 different rooms :/
Kyle Holm
@thekholm80
Jul 24 2017 20:48
seems to be all the rage these days
that waiting 30 sec for someone to answer is killer
Coy Sanders
@coymeetsworld
Jul 24 2017 20:49
wasting peoples time answering too
who knows if he even reads this
Kyle Holm
@thekholm80
Jul 24 2017 20:50
bleh, forgot how to do conditional styling in jsx
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 20:51
Does anybody know of a good tutorial for grids in bootstrap? I read the documentation and Im still having trouble with creating seperate pages on the home page for my portfolio. https://codepen.io/scodavinci/pen/zdOdNY
Kenneth-Brisco
@Kenneth-Brisco
Jul 24 2017 21:04
Hello
Ginger
@GingerChew
Jul 24 2017 21:39
Hey I'm really getting stuck on this weather api checker, can I get a second pair of eyes? I'm making 0 progress after searching around on line
I can't seem to get the page to read out the api information
Coy Sanders
@coymeetsworld
Jul 24 2017 21:45
@GingerChew looks like you're trying to use jQuery, but you haven't imported it into the project
Ginger
@GingerChew
Jul 24 2017 21:45
...gotcha...is that in the settings for the pen?
Coy Sanders
@coymeetsworld
Jul 24 2017 21:46
yes thats the easiest way
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:46
hello everyone can someone check my pairwise exercise?dont know what im missing in here
Ginger
@GingerChew
Jul 24 2017 21:47
okay, so I got the jquery loaded, but that didn't change anything? Is my jquery messed up?
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:47

function pairwise(arr, arg) {
  return arr.reduce(function(acc, obj,index, array){ 
    for(var i = 0; i < arr.length; i++){
      if(obj + arr[i] === arg && arr.indexOf(arr[i]) !== arr[index]){
        acc += arr.indexOf(arr[i]);
        acc += array[index];
        arr.slice(0, arr.indexOf(arr[i])).concat(arr.slice(arr.indexOf(arr[i])+1));
        arr.slice(0, array[index]).concat(arr.slice(array[index]+1));
      }
    }
    return acc;
  },0);
}

pairwise([1,4,2,3,0,5], 7);
Kyle Holm
@thekholm80
Jul 24 2017 21:47
@tiagocorreiaalmeida :point_up: July 24, 2017 3:40 PM
István Kozma
@Manfred28
Jul 24 2017 21:47
@GingerChew you are kind of mixing jquery and vanilla js
Tiago Correia
@tiagocorreiaalmeida
Jul 24 2017 21:48
@thekholm80 yeah sleepy sorry
Ginger
@GingerChew
Jul 24 2017 21:49
@Manfred28 so how should I fix that? I thought I could use them together?
István Kozma
@Manfred28
Jul 24 2017 21:51

I mean

var location = $("document").getElementById("location");

is really

var location = $("#location") in jquery

https://stackoverflow.com/questions/4069982/document-getelementbyid-vs-jquery

Ginger
@GingerChew
Jul 24 2017 21:51
okay cool
István Kozma
@Manfred28
Jul 24 2017 21:51
never mind anything else that might be going on, this is literally the first error the console spits out
Ginger
@GingerChew
Jul 24 2017 21:52
Okay cool, so I fixed that, and now my pen leads to a codepen 404 page...
nvm fixed it by moving variables into document ready part of js
István Kozma
@Manfred28
Jul 24 2017 21:54
pen.js:8 Uncaught ReferenceError: position is not defined
at success (pen.js:8)
Ginger
@GingerChew
Jul 24 2017 21:54
how did you get that kind of error message?
István Kozma
@Manfred28
Jul 24 2017 21:54
uh
right click -> inspect
switch to console
at the top
Ginger
@GingerChew
Jul 24 2017 21:55
true
I was using code pens console
István Kozma
@Manfred28
Jul 24 2017 21:55
yeah, dont
its ok for some stuff, but it doesnt properly display error messages
Ginger
@GingerChew
Jul 24 2017 21:56
I can see that lol
thanks @Manfred28
CamperBot
@camperbot
Jul 24 2017 22:01
gingerchew sends brownie points to @manfred28 :sparkles: :thumbsup: :sparkles:
:cookie: 167 | @manfred28 |http://www.freecodecamp.com/manfred28
István Kozma
@Manfred28
Jul 24 2017 22:04
you are welcome, hope it helps
Ginger
@GingerChew
Jul 24 2017 22:05
it for sure does! now that I know whats actually going wrong
dyon3334
@dyon3334
Jul 24 2017 22:24
javascript: switch vs if ?
Coy Sanders
@coymeetsworld
Jul 24 2017 22:29
@dyon3334 don't post that question in multiple chat rooms
especially after you did it 2 hours ago and people actually responded to you...
dyon3334
@dyon3334
Jul 24 2017 22:33
javascript: switch vs if vs Ternary Operator ?
Kyle Holm
@thekholm80
Jul 24 2017 22:36
troll: troll or troll?
CamperBot
@camperbot
Jul 24 2017 22:36
:trollface: troll problems? notify admins here
Mike Batista
@mbmontana
Jul 24 2017 22:51
OK, I've been trying to teach myself for days but I just can't Google anything that answers my question. I want one section of my portfolio page to have a background photo with three buttons over the photo. I want the buttons in a specific place in the photo. Any thoughts?
korzo
@korzo
Jul 24 2017 23:06
@mbmontana If you want pixel-perfect placement, you can use position:absolute with fixed dimensions of section, but it will be hard to maintain for different screen resolutions
cowCrazy
@cowCrazy
Jul 24 2017 23:09
@mbmontana looking for something like that?
Mike Batista
@mbmontana
Jul 24 2017 23:12
It's a stock photo of an office, and right in the middle is a blank computer screen. I want to put the three buttons right on the computer screen. But my first problem is I don't know how to put anything on top of an image. I need to know that first.
cowCrazy
@cowCrazy
Jul 24 2017 23:13
@mbmontana use the image as the background of a div, and force the buttons to place with position: absolute and then as you can see in my ex. with left and top
Mike Batista
@mbmontana
Jul 24 2017 23:16
@cowCrazy You have a div CSS declaration, but not all my divs will be the same.
cowCrazy
@cowCrazy
Jul 24 2017 23:17
@mbmontana it was just for the example, you can give the div a class or id
Mike Batista
@mbmontana
Jul 24 2017 23:18
@cowCrazy ok, keep forgetting about id's. I'm still pretty much at kindergarten level.