These are chat archives for FreeCodeCamp/HelpFrontEnd

19th
Jan 2018
Peh Hui Shi
@pehhuishi
Jan 19 2018 00:19
Hey! Thank you very much
Naris R
@KittenHero
Jan 19 2018 00:38
wouldn't the search result be different for every person who follows the link?
Kent Saeteurn
@sansae
Jan 19 2018 00:47
@khaduch hey ken, thank you for the response; i actually solved the problem; the issue wasn't with how i was rounding, but rather the equation that i used to find the orbitalPeriod. It turned out that I was slightly off with my results due to a calculation error
CamperBot
@camperbot
Jan 19 2018 00:47
sansae sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3684 | @khaduch |http://www.freecodecamp.org/khaduch
jimmy · YIN
@jimmyYSY
Jan 19 2018 02:30
sorry i want to know how many problems there are in FreeCodeCamp
Kaz Baig
@kbaig
Jan 19 2018 02:52
@jimmyYSY You can look at the map from the navbar
jimmy · YIN
@jimmyYSY
Jan 19 2018 02:55
em bug i con't find the navbar from freecodecamp.cn
sorry i want to s but
Kaz Baig
@kbaig
Jan 19 2018 04:00
@jimmyYSY china might be different
Nikhil Raj A
@nikhilrajnair
Jan 19 2018 04:05
hello any scss experts here ?
Kaz Baig
@kbaig
Jan 19 2018 04:05
@nikhilrajnair you should just post your question :)
Nikhil Raj A
@nikhilrajnair
Jan 19 2018 04:07
how can i select class2 inside this div using scss <div class="class1 class2">hello</div> ? in css we can use .class1.class2
Kaz Baig
@kbaig
Jan 19 2018 04:08
Not sure why it would be different
Nikhil Raj A
@nikhilrajnair
Jan 19 2018 04:10
actuall i need to use this for background color change
as class1 as parent and class2 for changing bg only
three are lot of class2,class3 etc in with class1
<div class="class1 class2">hello</div>
<div class="class1 class3">hello</div>
like this layout
jimmy · YIN
@jimmyYSY
Jan 19 2018 05:35
@kbaig thanks
CamperBot
@camperbot
Jan 19 2018 05:35
jimmyysy sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 538 | @kbaig |http://www.freecodecamp.org/kbaig
SAURABH SHEORAIN
@SSheorain
Jan 19 2018 08:59
semantic.min.js:17 Sidebar: Had to move sidebar. For optimal performance make sure sidebar and pusher are direct children of your body tag <div class=​"ui left vertical menu sidebar uncover animating visible" id=​"sidebar_mobile">​
Javier Pons
@JavierPons
Jan 19 2018 09:41
I need help with bootstrap issue
Kanav
@kanavbh
Jan 19 2018 10:21
What does class container-fluid do in bootstrap?
Marouane R
@mrassili
Jan 19 2018 10:23
makes the div take the whole page width?
Kanav
@kanavbh
Jan 19 2018 10:24
Thank you @mrassili
CamperBot
@camperbot
Jan 19 2018 10:24
:cookie: 255 | @mrassili |http://www.freecodecamp.org/mrassili
kanavbh sends brownie points to @mrassili :sparkles: :thumbsup: :sparkles:
Marouane R
@mrassili
Jan 19 2018 10:28
Anytime @kanavbh
mubaraka1
@mubaraka1
Jan 19 2018 11:26
heloo devs what do i need to be a full front end developer
Markus Kiili
@Masd925
Jan 19 2018 11:28
@mubaraka1 HTML+CSS+JS + some front-end framework + some knowledge of things outside front end.
yozhikvtumane
@yozhikvtumane
Jan 19 2018 11:31
Any tutorials about how to debug javascript?
icad123
@icad123
Jan 19 2018 11:41
@yozhikvtumane
chrome dev tools?
i think there is even a chrome dev tolls course in the free code camp map, maybe you could try it out
Muhammed Hafiz
@zifahm
Jan 19 2018 11:54
is there anyway in setState that i can only update one object in an object eg:
state={ name:{first:"asdf", last:"asdf"}
setState={ name.first:"asdfa"} and not update the last name ?
i know this wont work makes the last name taken out of the object
Markus Kiili
@Masd925
Jan 19 2018 11:58
@zifahm Do you mean state.name.first = "asdfa"; ?
Muhammed Hafiz
@zifahm
Jan 19 2018 11:58
yeah
Markus Kiili
@Masd925
Jan 19 2018 11:58
That should just update the value there.
Muhammed Hafiz
@zifahm
Jan 19 2018 11:59
i dont want the value of name.last to be lost
Markus Kiili
@Masd925
Jan 19 2018 12:00
It will not be lost.
Muhammed Hafiz
@zifahm
Jan 19 2018 12:00
no im getting an error would you take a look at my code?
Markus Kiili
@Masd925
Jan 19 2018 12:01
var state={ name:{first:"asdf", last:"asdf"}};

state.name.first = "asdfa";

console.log(state); // { name: { first: 'asdfa', last: 'asdf' } }
One brace was missing in your code.
Muhammed Hafiz
@zifahm
Jan 19 2018 12:01
no im taking about setstate
i got it
this.setState = { name: {...this.state.name, first: "newfirst"}} by StephanJames
Stephen James
@sjames1958gm
Jan 19 2018 12:08
@Masd925 He is doing React - so no mutation of the state variable, has to create a new object
Markus Kiili
@Masd925
Jan 19 2018 12:09
@sjames1958gm Yeah.
yozhikvtumane
@yozhikvtumane
Jan 19 2018 12:09

@icad123

i think there is even a chrome dev tolls course in the free code camp map, maybe you could try it out

This video is in-depth and covers everything you need to know.
false

Aditya
@ezioda004
Jan 19 2018 12:18
Its in the video challenges but not really in-depth more like it introduces you.
icad123
@icad123
Jan 19 2018 13:31
guys I need help about the building random quote machine project
I use the forismatic API and it works well so far
but when I click the new quote button rapidly/request the api call rapidly, the api return the same quote
how do I solve this?
Tom
@moT01
Jan 19 2018 13:40
dont push the button rapidly? @icad123
icad123
@icad123
Jan 19 2018 13:55
nevermind, I solved it, seems like I made some mistake on the random number generator for the quote keys
Stephen James
@sjames1958gm
Jan 19 2018 13:55
@icad123 The API allows you to request more than one quote, you could request more than one and simply randomize over those.
icad123
@icad123
Jan 19 2018 14:00
@sjames1958gm how? I don't think they mention anything like that on the website
Stephen James
@sjames1958gm
Jan 19 2018 14:04
@icad123 let me check my notes
@icad123 Hmm, must be another API that allows that I don't see that in my forismatic notes.
ah, I think it was quotesondesign
Tom
@moT01
Jan 19 2018 14:07
you could disable the button while its getting a quote
what do you want to happen
icad123
@icad123
Jan 19 2018 14:13
but it would looks slow
Dardan Demiri
@dardandemiri
Jan 19 2018 14:14
Hello People
Stephen James
@sjames1958gm
Jan 19 2018 14:14
@dardandemiri :wave:
christopher clarke
@chrisdclarke
Jan 19 2018 14:14
Good Morning from Vancouver,,,
icad123
@icad123
Jan 19 2018 14:15
nevermind, I solved it already, because I didn't specify the random number in the query
christopher clarke
@chrisdclarke
Jan 19 2018 14:15
can anyone help me... I cant get this ajax call to work,, i read somewhere about having to use a proxy with codepen, but i dunno...

window.onload = function(){

$.ajax({
type: "GET",
url: "http://labs.bible.org/api/?passage=random",
success: function(data){
console.log(data);
}
})}

any idea why this doesnt work??
i get this error in the console. and no data,,,
Dardan Demiri
@dardandemiri
Jan 19 2018 14:17
Can anyone please explain what is the #100DaysOfCode
I know that it is a Hashtag, but when does it start
or how
Tom
@moT01
Jan 19 2018 14:22
you just start yourself whenever you want @dardandemiri
@chrisdclarke do you have a pen? why are you using 2.2.4?
Dardan Demiri
@dardandemiri
Jan 19 2018 14:22
yes but is it necessary to make push in Github
Tom
@moT01
Jan 19 2018 14:23
no @dardandemiri
Dardan Demiri
@dardandemiri
Jan 19 2018 14:23
its just a commitment or what
Tom
@moT01
Jan 19 2018 14:23
there's nobody like keeping track of anything
yea - its just for motivation
Muhammed Hafiz
@zifahm
Jan 19 2018 14:24
can we do a ternary condition inside a set state?
christopher clarke
@chrisdclarke
Jan 19 2018 14:28
l @moT01 yeah, im using codepen... https://codepen.io/chrisdclarke/pen/LereRP
im just trying to get a random bible quote,,
i have to go to my day job..
Tom
@moT01
Jan 19 2018 14:32
and im supposed to read that function how?
christopher clarke
@chrisdclarke
Jan 19 2018 14:32
doesnt it run.. onload?
i gotta run.... thanks...
Tom
@moT01
Jan 19 2018 14:33
well, if you want to chat about it later come on back
ehutchllew
@ehutchllew
Jan 19 2018 14:42
@zifahm yes
Dardan Demiri
@dardandemiri
Jan 19 2018 14:52
@moT01 Thank You
CamperBot
@camperbot
Jan 19 2018 14:52
dardandemiri sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 961 | @mot01 |http://www.freecodecamp.org/mot01
Xapuu
@Xapuu
Jan 19 2018 15:06
Hello guys i have the followin trouble => I have some focus/focusout logic and the focusout is triggered without clicking outside of the element which holds the focusout event, any ideas?
Jefferson
@jeffersonnnn
Jan 19 2018 15:08
hi guys, first and foremost: thank you for the community feel of this place. Whenever, i come back, it never feels like. So here is m problem: i am trying to implement a carousel effect on a web page, i think(?) i am getting the code right, but the effect isn't just happening. Here is my script.js code

var slideInterval = 3500;

function getFigures() {
    return document.getElementById('carousel').getElementsByTagName('figure');
}

function moveForward() {
    var pointer;
    var figures = getFigures();
    for (var i = 0; i < figures.length; i++) {
        if (figures[i].className == 'visible') {
            figures[i].className = '';
            pointer = i;
        }
}
if (++pointer == figures.length) {
    pointer = 0;
}

figures[pointer].className = 'visible';
setTimeout(moveForward, slideInterval);

function startPlayback() {
    setTimeout(moveForward, slideInterval);
}

startPlayback();
Please somebody, anybody, give me a clue as to where error is.
Stephen James
@sjames1958gm
Jan 19 2018 15:14
@jeffersonnnn Check my comment in HelpJavaScript
Jefferson
@jeffersonnnn
Jan 19 2018 15:16
@sjames1958gm i am headed over there right now. Thanks.
CamperBot
@camperbot
Jan 19 2018 15:16
jeffersonnnn sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8871 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Tom
@moT01
Jan 19 2018 15:19
@Xapuu have a pen or some code to show or anything
Marc
@MWBauer
Jan 19 2018 15:32
Hi everyone
Kaz Baig
@kbaig
Jan 19 2018 15:33
@MWBauer :wave:
Marc
@MWBauer
Jan 19 2018 15:34
oh lord
my wifes name is Lisa
Kaz Baig
@kbaig
Jan 19 2018 15:35
Your life is the timeline in which "everybody betray me" didn't happen
Marc
@MWBauer
Jan 19 2018 15:36
umm...ok
Kaz Baig
@kbaig
Jan 19 2018 15:36
I'm guessing you haven't seen the movie recently haha
Marc
@MWBauer
Jan 19 2018 15:37
not recently. years ago
Kaz Baig
@kbaig
Jan 19 2018 15:37
The man goes "everybody betray me" and blows his brains out
Marc
@MWBauer
Jan 19 2018 15:41
nothing happening here?
Kaz Baig
@kbaig
Jan 19 2018 15:42
It's still relatively early in the work day
Wait for people to start Friday-slacking ;)
Marc
@MWBauer
Jan 19 2018 15:45
lol
I
I'm trying to learn, so I am here. Hope ya'll are ready for questions
LIke.....can you compare 2 arrs?
Kaz Baig
@kbaig
Jan 19 2018 15:47
Sure
Mark
@vinarius
Jan 19 2018 15:47
you can use if else statements to compare
Marc
@MWBauer
Jan 19 2018 15:47
Ok.
Mark
@vinarius
Jan 19 2018 15:47
if(arr1 === arr2){//do stuff} else {//do other stuff}
Kaz Baig
@kbaig
Jan 19 2018 15:51
I'm not sure if the above is right:
console.log([1, 2, 3] === [1, 2, 3]); // false
console.log([1, 2, 3] == [1, 2, 3]); // false
@vinarius @MWBauer
Mark
@vinarius
Jan 19 2018 15:58
here
Marc
@MWBauer
Jan 19 2018 15:58
I'm working on the diff of two arrays challenge. I have broken the diffArray into 2 arrays.
Mark
@vinarius
Jan 19 2018 15:59
function checkArrays(input1, input2){

  for(let i = 0; i<input1.length; i++){
      if(input1[i] !== input2[i]){
        return false;
      } else {
        return true;
      }
  }

}

checkArrays(arr1, arr2);
Marc
@MWBauer
Jan 19 2018 15:59
now if they aren't the same I should filter, find the difference, slice, and make a new arr
sound about right?
Kaz Baig
@kbaig
Jan 19 2018 16:02
@MWBauer the logic I followed was to apply Array.filter on both arrays, removing elements that occurred in the other one. I then concatenate the resulting arrays
Marc
@MWBauer
Jan 19 2018 16:02
ok
Marc
@MWBauer
Jan 19 2018 16:37
I'm trying to work this. What direction did you go with the filter?
@kbaig
Kaz Baig
@kbaig
Jan 19 2018 16:38
@MWBauer im checking to see if the element can be found in the other array
within the callback
Marc
@MWBauer
Jan 19 2018 16:40
so yu used ===?
Kaz Baig
@kbaig
Jan 19 2018 16:40
with I used Array.includes
Sweet Coding :)
@SweetCodingInc
Jan 19 2018 16:41
@vinarius That code will return true whenever the first element matches. You need to do
function checkArrays(input1, input2) {
  for (let i = 0; i < input1.length; i++) {
    if (input1[i] !== input2[i]) {
      return false;
    }
  }
  return true;
}
And this will work ONLY when input1.lengthis greater than or equal toinput2.length
Marc
@MWBauer
Jan 19 2018 16:48
i'm out.
Got stuffs to do.
Dimitris Nik.
@dimitrissnk
Jan 19 2018 16:48
Hey guys! I have a problem understanding sizing and positioning. What's the point of using size elements, margin padding etc, as our website will be displayed differently on every device and screen? I always had problem working with sizing and positioning of html elements :(
Marc
@MWBauer
Jan 19 2018 16:48
Someone finish all of these challenges for me and I will be back later. Thanks.
lol
Toni Shortsleeve
@KoniKodes
Jan 19 2018 16:50
@Yotta51 You can use media queries to change the margin sizes by screen. Or you can use em /rem instead of px.
Matej Bošnjak
@mbosnjak01
Jan 19 2018 18:09
Hi. Anyone tried working with http://opalang.org/ ?
Olga
@OStefani
Jan 19 2018 19:00
@Dimitrios51 you should use different sizes for different devices.
Hal Morgan
@halbmorgan
Jan 19 2018 19:43
Hi everybody, I'm new here :-) I'm trying to finish my first FreeCodeCamp project, and I can't get the row class to put my photos side-by-side. Could someone take a look at see what I've messed up?
<div class="row">
<div class="photo col-xs-4">
<img src="https://lionaid.org/media/spartpressImages/loss-of-an-apex-predator-1.png"></img></div>
<div class="photo col-xs-8">
<img src="http://assets.fwi.co.uk/George-Monbiot-%C2%A9Rex-Shutterstock-615x346.jpg"></img></div>
</div>
LKian
@LKian
Jan 19 2018 19:55
do you have a codepen @halbmorgan
Hal Morgan
@halbmorgan
Jan 19 2018 19:57
yep! that's what I'm using
LKian
@LKian
Jan 19 2018 19:58
Link? Oh wait I think that col-xs- doesn't exist in bootstrap4 anymore
Hal Morgan
@halbmorgan
Jan 19 2018 19:58
ohhhh
LKian
@LKian
Jan 19 2018 19:58
try col-4 and col-8
working for me in codepen
Hal Morgan
@halbmorgan
Jan 19 2018 19:59
It worked thank you!!
LKian
@LKian
Jan 19 2018 19:59
also I don't think you need the closing img tag - img tags don't have the </img> part
Hal Morgan
@halbmorgan
Jan 19 2018 20:00
yeah you're right, I'm not used to what needs to be closed and what doesn't
VaseJS
@VaseJS
Jan 19 2018 20:00
@kahwasaurus is correct. img tags are self closing
Hal Morgan
@halbmorgan
Jan 19 2018 20:01
thanks guys @VaseJS @kahwasaurus
CamperBot
@camperbot
Jan 19 2018 20:01
halbmorgan sends brownie points to @vasejs and @kahwasaurus :sparkles: :thumbsup: :sparkles:
:cookie: 464 | @vasejs |http://www.freecodecamp.org/vasejs
:cookie: 307 | @kahwasaurus |http://www.freecodecamp.org/kahwasaurus
LKian
@LKian
Jan 19 2018 20:01
you'll get the hang of it. I randomly lose memory of url tags and img srcs every few wks
Markus Kiili
@Masd925
Jan 19 2018 20:03
@halbmorgan Using such closing tag is actually invalid html.
Hal Morgan
@halbmorgan
Jan 19 2018 20:05
gotcha thank you @Masd925
CamperBot
@camperbot
Jan 19 2018 20:05
halbmorgan sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4662 | @masd925 |http://www.freecodecamp.org/masd925
jjzep
@jjzep
Jan 19 2018 21:27
I’m trying to disable a button and the code looks good to me, but it doesn’t persist
jjzep
@jjzep
Jan 19 2018 21:35
Using ES6, would disabling an HTML button only persist within the scope of the class?
VaseJS
@VaseJS
Jan 19 2018 21:37
@jjzep show code
jjzep
@jjzep
Jan 19 2018 21:38
 endGame() {
        let attackButton = $('#attack');
        if (this.gameOver) {
            attackButton.html('TARGET DETROYED');
            attackButton.disabled = true;
            console.log('game over');
            console.log(attackButton.disabled);
        }
    }
ehutchllew
@ehutchllew
Jan 19 2018 21:39
thanks
is the condition being met otherwise?
are you seeing 'game over'?
@jjzep try attackButton.prop('disabled', true);
jjzep
@jjzep
Jan 19 2018 21:41
it evaluates at the end in the Chrome dev tools, and it stays true for a while
ok
Aditya
@ezioda004
Jan 19 2018 21:41
@jjzep this.setAttribute("disabled", true); should work
ehutchllew
@ehutchllew
Jan 19 2018 21:42
@ezioda004 using this won't do anything for the button.
jjzep
@jjzep
Jan 19 2018 21:43
@ehutchllew this worked! Do you know why it worked and the other method didn’t?
ehutchllew
@ehutchllew
Jan 19 2018 21:44
@jjzep i'm just not familiar with the .disabled() method, but I know jquery's prop() method, so that's my logic hah.
jjzep
@jjzep
Jan 19 2018 21:44
ahh ok
I dunno, anyways thank you
ehutchllew
@ehutchllew
Jan 19 2018 21:47
yeah i don't know.
xuhih
@xuhih
Jan 19 2018 23:58
How come this wont increase the number on the button?