These are chat archives for FreeCodeCamp/Help

7th
Aug 2017
Gulsvi
@gulsvi
Aug 07 2017 00:11 UTC
@serpad no, it doesn't assign them the same class automatically, but some CSS properties will be inherited
serpad
@serpad
Aug 07 2017 00:16 UTC
So a container div is necessary. Thanks @SkyC0der
CamperBot
@camperbot
Aug 07 2017 00:16 UTC
serpad sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2331 | @skyc0der |http://www.freecodecamp.com/skyc0der
Mohamed Nabil Ayoub
@MohNabil
Aug 07 2017 00:36 UTC
can any one review my php code and tell me what’s wrong in the submit form
Jill Lee
@jill-lee
Aug 07 2017 00:54 UTC
Help, im stuck. My project works on codepen but wont work on github on the portfolio section. The overlays doesnt work. Also, BG image on class .bgimg-2 { doesnt work on mobile.
https://codepen.io/phoenix-burn/pen/bRRaEO - codepen
https://phoenix-burn.github.io/portfolio-project/ - github
stealthygame
@stealthygame
Aug 07 2017 01:12 UTC
Can someone help me with the Arguments Optional algorithm ?
I dont understand what the test means by addTogether(2)(3)
I don't even know what to call it so that I can google it or anything.
Gulsvi
@gulsvi
Aug 07 2017 01:38 UTC
@phoenix-burn your github html seems to be missing a closing </body> and </html> tag. It also doesn't have a DOCTYPE
Moisés Man
@moigithub
Aug 07 2017 01:52 UTC
google currying @stealthygame
stealthygame
@stealthygame
Aug 07 2017 01:54 UTC
@moigithub so the inner function just automatically picks up the next ... "argument" ?
Claudio Restifo
@Marmiz
Aug 07 2017 02:42 UTC
@stealthygame currying is a technique to pass arguments to a subset of function that are waiting for those arguments to start executing.
It's not as common in JS, but way more common (or crucial) in other languages.
In many other languages is common to wait for the user input to keep executing functions.
Claudio Restifo
@Marmiz
Aug 07 2017 02:49 UTC
An example in js:
// a function that returns a function
const curry = (greeting) => {
  return (name) => {
    console.log(`${greeting}, ${name}`);
  };
};

// then I can assign the first function a value and pass the second value after
const hello = curry('Hello');
hello('Marmiz'); // "Hello, Marmiz"
hello('stealthygame'); // "Hello, stealthygame"

// or directly pass the two arguments
curry('Hi')('chat') // "Hi, chat "
stealthygame
@stealthygame
Aug 07 2017 03:01 UTC
@Marmiz @moigithub Thanks guys, I think I'm starting to see it now :)
CamperBot
@camperbot
Aug 07 2017 03:01 UTC
stealthygame sends brownie points to @marmiz and @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1013 | @marmiz |http://www.freecodecamp.com/marmiz
:star2: 3560 | @moigithub |http://www.freecodecamp.com/moigithub
Jill Lee
@jill-lee
Aug 07 2017 03:07 UTC
@SkyC0der thanks! I forgot!! :D
CamperBot
@camperbot
Aug 07 2017 03:07 UTC
phoenix-burn sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2332 | @skyc0der |http://www.freecodecamp.com/skyc0der
prakash chandra yadav
@prakashyadav008
Aug 07 2017 05:25 UTC
has anyone completed the arguments optional challange from fcc
CamperBot
@camperbot
Aug 07 2017 05:34 UTC
phoenix-burn sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1583 | @heroiczero |http://www.freecodecamp.com/heroiczero
Nahuel Ovejero
@NahuelOvejero
Aug 07 2017 06:49 UTC
:wave:
Jill Lee
@jill-lee
Aug 07 2017 06:51 UTC
Why is JS not working with html on git?
korzo
@korzo
Aug 07 2017 06:55 UTC
@phoenix-burn do you mean Github?
Jill Lee
@jill-lee
Aug 07 2017 07:09 UTC
@korzo Yes my codes work exept js
korzo
@korzo
Aug 07 2017 07:22 UTC
@phoenix-burn xcroller.js and jquery.fittext.js are not in the repository
@phoenix-burn you have jQuery code at the top of your code, before jQuery is loaded
Fer de Nanz
@ferdenanz
Aug 07 2017 07:25 UTC
Hi, dudes!
Jill Lee
@jill-lee
Aug 07 2017 07:25 UTC
@korzo thanks! Missed it along with the doctype and closing tags earlier I think its time to rest.
CamperBot
@camperbot
Aug 07 2017 07:25 UTC
phoenix-burn sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 348 | @korzo |http://www.freecodecamp.com/korzo
Fer de Nanz
@ferdenanz
Aug 07 2017 07:27 UTC
I can
I can't see why my solution doesn't work for the Profile Lookup challenge.
Fer de Nanz
@ferdenanz
Aug 07 2017 07:32 UTC
for (var i = 0; i < contacts.length; i++) {
  if (firstName === contacts[i].firstName) {
    if (prop === "lastName") {
      return contacts[i].lastName;
    } else if (prop === "number") {
      return contacts[i].number;
    } else if (prop === "likes") {
      return contacts[i].likes;
    } else {
      return "No such property";
    }
  } else {
    return "No such contact";
  }
}
Eric Miller
@ericmiller777
Aug 07 2017 07:35 UTC
hey
Eric Miller
@ericmiller777
Aug 07 2017 07:40 UTC
$.ajax({
    url: 'https://en.wikipedia.org/w/api.php?action=opensearch&search=blue&limit=10&namespace=0&format=json',
    data: {
        format: 'json'
    },
    dataType: 'jsonp'
}).done( function ( data ) {
    $(".testWiki").html(" ");
    $(".testWiki").append(data[1][0].content + " " + data[2][0].title);
} );
what am i missing?
iso
@iso1048
Aug 07 2017 07:42 UTC
@ericmiller777 when i did it, I didnt have data in the ajax call. I used type: "GET",. Not sure if that is the problem -just pointing it out.
Eric Miller
@ericmiller777
Aug 07 2017 07:43 UTC
@gothamknight thanks do you know what CORS is or how it works should i just use that?
CamperBot
@camperbot
Aug 07 2017 07:43 UTC
ericmiller777 sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 357 | @gothamknight |http://www.freecodecamp.com/gothamknight
iso
@iso1048
Aug 07 2017 07:43 UTC
@ericmiller777 im not the best person to answer that. But I think your code is fine since you are requesting jsonp as opposed to json (i think is CORS is like sharing data from different domains or something...?)
Eric Miller
@ericmiller777
Aug 07 2017 07:44 UTC
lol yesterday i was trying to use json till someone on here pointed me toward learning to use the ajax call
$.ajax({
    url: 'https://en.wikipedia.org/w/api.php?action=opensearch&search=blue&limit=10&namespace=0&format=json',
    type: GET,
    dataType: 'jsonp'
}).done( function ( data ) {
    $(".testWiki").html(" ");
    $(".testWiki").append(data[1][0].content + " " + data[2][0].title);
} );
i think im doing it wrong
iso
@iso1048
Aug 07 2017 07:46 UTC
type: 'GET'
korzo
@korzo
Aug 07 2017 07:46 UTC
@ericmiller777 You can add &origin=* to wikipedia api url and use it without jsonp
@ericmiller777 It will enable CORS on wikipedia api
Eric Miller
@ericmiller777
Aug 07 2017 07:46 UTC
I add that to the regual get?
regular?
korzo
@korzo
Aug 07 2017 07:47 UTC
@ericmiller777 yes
Eric Miller
@ericmiller777
Aug 07 2017 07:48 UTC
@korzo thanks id like to try and figure this out too i guess, but where would i add that just after formast=json?
CamperBot
@camperbot
Aug 07 2017 07:48 UTC
ericmiller777 sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 349 | @korzo |http://www.freecodecamp.com/korzo
Eric Miller
@ericmiller777
Aug 07 2017 07:48 UTC
format
@gothamknight do you know why im still getting undefined?
korzo
@korzo
Aug 07 2017 07:50 UTC
@ericmiller777 Position doesn't matter . In URL ? means parameters will follow and & is parameters separator
Eric Miller
@ericmiller777
Aug 07 2017 07:50 UTC
@korzo thanks
CamperBot
@camperbot
Aug 07 2017 07:50 UTC
ericmiller777 sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:warning: ericmiller777 already gave korzo points
korzo
@korzo
Aug 07 2017 07:52 UTC
@ferdenanz Is this FCC challenge ?
Eric Miller
@ericmiller777
Aug 07 2017 07:52 UTC
@korzo it is
iso
@iso1048
Aug 07 2017 07:54 UTC
@ericmiller777 did you change to type: 'GET'?
Eric Miller
@ericmiller777
Aug 07 2017 07:55 UTC
yes
iso
@iso1048
Aug 07 2017 07:55 UTC
have you added jquery?
Eric Miller
@ericmiller777
Aug 07 2017 07:55 UTC
yes
iso
@iso1048
Aug 07 2017 07:55 UTC
sorry dude dont know then. could you link your pen?
Eric Miller
@ericmiller777
Aug 07 2017 07:56 UTC
yes
iso
@iso1048
Aug 07 2017 08:04 UTC
@ericmiller777 you dont need .content when access the data in the json. just use:
$(".testWiki").append(data[1][0] + " " + data[2][0]);
korzo
@korzo
Aug 07 2017 08:04 UTC
@ericmiller777
$.ajax({
    url: 'https://en.wikipedia.org/w/api.php?action=opensearch&search=blue&limit=10&namespace=0&format=json',
    type: "GET",
    dataType: 'jsonp'
    }).done( function ( data ) {

    $(".testWiki").html(" ");
    $(".testWiki").append(data[1][0] + " " + data[2][0]);
}
iso
@iso1048
Aug 07 2017 08:04 UTC
@korzo just beat you to it haha (not a mocking laugh; i am just joking)
Eric Miller
@ericmiller777
Aug 07 2017 08:09 UTC
.>
really
wow
@gothamknight thanks
CamperBot
@camperbot
Aug 07 2017 08:10 UTC
ericmiller777 sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:warning: ericmiller777 already gave gothamknight points
Eric Miller
@ericmiller777
Aug 07 2017 08:10 UTC
@korzo thanks
why did i use .content with my quote viewer then?
iso
@iso1048
Aug 07 2017 08:13 UTC
@ericmiller777 because that json has a property called 'content'
@ericmiller777 inside your .done function, console.log(data); to see the json that the wikiapi is sending
@lanbaoer
Aug 07 2017 08:15 UTC
聊天室 全屏了,怎样退出,亲?
Eric Miller
@ericmiller777
Aug 07 2017 08:15 UTC
oh okay
i understand
@gothamknight thanks
CamperBot
@camperbot
Aug 07 2017 08:15 UTC
ericmiller777 sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:warning: ericmiller777 already gave gothamknight points
@lanbaoer
Aug 07 2017 08:17 UTC
怎样退出 markdown help
新手刚到
Emmanuel Akodia
@akodiaemma
Aug 07 2017 09:00 UTC
@diomed hahaha nuh its a design.. not meant to be fear but like "please please please check me out"
@diomed do you like it? honestly
Owais Ahmed
@owaisehmed
Aug 07 2017 09:04 UTC
How would i check for a special character in a string?
str = "This is a string!";
or str = "This is a string?";
iso
@iso1048
Aug 07 2017 09:07 UTC
@owaisehmed regex? character codes?
stuartbiggs
@stuartbiggs
Aug 07 2017 11:54 UTC
hi campers
Darth Skywalker
@AdiSkywalker
Aug 07 2017 11:57 UTC
@stuartbiggs @akodia488 :wave:
stuartbiggs
@stuartbiggs
Aug 07 2017 11:57 UTC
@AdiSkywalker you again!!!
@AdiSkywalker should I use regex in the palindrome exercise?
Darth Skywalker
@AdiSkywalker
Aug 07 2017 11:59 UTC
Yo!
stuartbiggs
@stuartbiggs
Aug 07 2017 11:59 UTC
@AdiSkywalker I assume thats yes
Darth Skywalker
@AdiSkywalker
Aug 07 2017 11:59 UTC
You could, but that will complicate things a way lot more
Oh! No! That yo was in response to you again"
stuartbiggs
@stuartbiggs
Aug 07 2017 12:00 UTC
@AdiSkywalker ok so how else do I check the string then?
Darth Skywalker
@AdiSkywalker
Aug 07 2017 12:02 UTC
Split the string reverse it, and then join back.. and compare what you got as result of join with your original string
@stuartbiggs
stuartbiggs
@stuartbiggs
Aug 07 2017 12:04 UTC
@AdiSkywalker that sounds pretty complicated as well but I will give it ago
Darth Skywalker
@AdiSkywalker
Aug 07 2017 12:05 UTC
Aww
stuartbiggs
@stuartbiggs
Aug 07 2017 12:05 UTC
@AdiSkywalker dont get cheeky
Darth Skywalker
@AdiSkywalker
Aug 07 2017 12:06 UTC
Assuming str to be your original string, you can do str === str.split('').reverse().join('')
stuartbiggs
@stuartbiggs
Aug 07 2017 12:07 UTC
@AdiSkywalker what about dealing with the special symbols etc?
Darth Skywalker
@AdiSkywalker
Aug 07 2017 12:07 UTC
Oh!
Sorry I don't remember the challenge in it's entirely
Do you need to ignore special characters?
Darth Skywalker
@AdiSkywalker
Aug 07 2017 12:09 UTC
Yes! For that you need regex
Sorry! My bad
First do str = str.replace(/your regex here/,'')
stuartbiggs
@stuartbiggs
Aug 07 2017 12:10 UTC
@AdiSkywalker no worries - at least I found out for certain that I do need regex for it
Darth Skywalker
@AdiSkywalker
Aug 07 2017 12:13 UTC
:+1:
stuartbiggs
@stuartbiggs
Aug 07 2017 12:20 UTC
@AdiSkywalker this is really starting to confuse me now
Darth Skywalker
@AdiSkywalker
Aug 07 2017 12:41 UTC
Aww
Albert Cardona II
@daddycardona
Aug 07 2017 12:48 UTC
okay last question on my twitch app since it works with no problem, why does the background not go to cover and changes size when i click on offline etc..?
korzo
@korzo
Aug 07 2017 13:01 UTC
@daddycardona Because height of the body changes
Albert Cardona II
@daddycardona
Aug 07 2017 13:02 UTC
yes but it is also not covered? or cover its just the main size of the image
Albert Cardona II
@daddycardona
Aug 07 2017 13:22 UTC
thanks korzo
thanks @korzo
CamperBot
@camperbot
Aug 07 2017 13:22 UTC
daddycardona sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 351 | @korzo |http://www.freecodecamp.com/korzo
stuartbiggs
@stuartbiggs
Aug 07 2017 13:39 UTC
@AdiSkywalker my regex sucks
Darth Skywalker
@AdiSkywalker
Aug 07 2017 13:50 UTC
@stuartbiggs show your code
stuartbiggs
@stuartbiggs
Aug 07 2017 13:54 UTC

@AdiSkywalker function palindrome(str) {
// Good luck!

var newString = str.replace(/(A-Z)\w+\D/g);

return true;
}

palindrome("eye");

Darth Skywalker
@AdiSkywalker
Aug 07 2017 13:56 UTC
yeah! that's horrible :laughing:
stuartbiggs
@stuartbiggs
Aug 07 2017 13:56 UTC
@AdiSkywalker thanks
CamperBot
@camperbot
Aug 07 2017 13:56 UTC
stuartbiggs sends brownie points to @adiskywalker :sparkles: :thumbsup: :sparkles:
:cookie: 353 | @adiskywalker |http://www.freecodecamp.com/adiskywalker
Darth Skywalker
@AdiSkywalker
Aug 07 2017 13:57 UTC
@stuartbiggs Check this site out. Best way to learn RegEx in my opinion.
build your RegEx there and then put it in your code
stuartbiggs
@stuartbiggs
Aug 07 2017 13:58 UTC
@AdiSkywalker thats where I got my regex from!!!
@AdiSkywalker I dont really understand properly yet
Lauri Välja
@OFFLlNE
Aug 07 2017 14:11 UTC
I have been using https://regex101.com/
@stuartbiggs don't worry... nobody understands regex really :joy:
stuartbiggs
@stuartbiggs
Aug 07 2017 14:12 UTC
@OFFLlNE thank you
CamperBot
@camperbot
Aug 07 2017 14:12 UTC
stuartbiggs sends brownie points to @offllne :sparkles: :thumbsup: :sparkles:
:star2: 1059 | @offllne |http://www.freecodecamp.com/offllne
stuartbiggs
@stuartbiggs
Aug 07 2017 14:13 UTC
that one looks a little more useful than the other site - sorry Adi
Darth Skywalker
@AdiSkywalker
Aug 07 2017 14:14 UTC
@stuartbiggs no worries! :laughing:
@lanbaoer
Aug 07 2017 14:21 UTC
how to quit markdown help?
full screen
Lauri Välja
@OFFLlNE
Aug 07 2017 14:22 UTC
press esc?
or press the x
@lanbaoer
Aug 07 2017 14:24 UTC
it still doesn't work
thanks @OFFLlNE
CamperBot
@camperbot
Aug 07 2017 14:25 UTC
lanbaoer sends brownie points to @offllne :sparkles: :thumbsup: :sparkles:
:star2: 1060 | @offllne |http://www.freecodecamp.com/offllne
Margaret
@Margaret2
Aug 07 2017 14:27 UTC
@OFFLlNE wow haven't seen you in forever :wave:
Mennaali
@MennaAly
Aug 07 2017 14:27 UTC
while i am working on the Twitchtv project, i faced this error "XMLHttpRequest cannot load https://wind-bow.gomix.me/twitch-api/channels/RobotCaleb&callback=?. Redirect from 'https://wind-bow.gomix.me/twitch-api/channels/RobotCaleb&callback=?' to 'https://wind-bow.glitch.me/twitch-api/channels/RobotCaleb&callback=?' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:49535' is therefore not allowed access." i know there's a problem in the CORS origin but after a little bit of searching i found that i should but &callback=? in the url to solve the error but it didn't can anyone help ?
knight2
@knight2
Aug 07 2017 14:27 UTC

Does anyone else experience situations when they are trying to make a react project using CodePen, your code was rendering just fine, and then all of the sudden after a few changes the react code doesn't render at all.

You delete your ENTIRE javascript section, rewrite a small hello world class, have ReactRender target your html div, and it still doesn't render?

Long Nguyen
@longnt80
Aug 07 2017 14:29 UTC
@MennaAly where did you get those urls from?
Lauri Välja
@OFFLlNE
Aug 07 2017 14:31 UTC
@Margaret2 yea, hola cutie :D
Sometimes having a bored minutes at work, then checking here for a few :D
Margaret
@Margaret2
Aug 07 2017 14:31 UTC
:D
Long Nguyen
@longnt80
Aug 07 2017 14:33 UTC
@MennaAly where did you find this: https://wind-bow.gomix.me?
Margaret
@Margaret2
Aug 07 2017 14:34 UTC
@knight2 probably just need to refresh the page, check for typos, not freak out
also save before refreshing
Long Nguyen
@longnt80
Aug 07 2017 14:35 UTC
@MennaAly try this: https://wind-bow.glitch.me/twitch-api/channels/<<account name>>
mine is still working: https://longnt80.github.io/twitchtv/
no need for callback
Mennaali
@MennaAly
Aug 07 2017 14:35 UTC
@longnt80 ok i will :D
dyon3334
@dyon3334
Aug 07 2017 14:47 UTC
what am i doing wrong i get comma's inside my string after joining them function reverseString(str) { var string = str; var array = string.split(""); var reversed = array.reverse(); return reversed.join(); } reverseString("hello");
Adrenaline
@Sp00dyGodAdrenaline
Aug 07 2017 14:51 UTC
Hey I need help with the challenge ; storing values with the assignment operator
I don't understand how to do it
Adrenaline
@Sp00dyGodAdrenaline
Aug 07 2017 14:59 UTC
Nvm I got it
Dylan
@dhcodes
Aug 07 2017 15:03 UTC
hey @OFFLlNE is back
Gil Alexandel
@gilalexandel
Aug 07 2017 15:07 UTC
someone here that could explain this ?
Darren
@DarrenfJ
Aug 07 2017 15:08 UTC
morning fCC
@gilalexandel your question is why use a variable when you can access an object property directly?
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:11 UTC
@DarrenfJ :wave:
Gil Alexandel
@gilalexandel
Aug 07 2017 15:12 UTC
@DarrenfJ Yeah. I don't understand the examples code
I mean, i get it but not quite there yet
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:13 UTC
I want to put a background on my web page, please who can help me?
Margaret
@Margaret2
Aug 07 2017 15:13 UTC

@gilalexandel say you have an object:

var obj = {
    'favoriteFood': 'cake',
    'favoriteColor': 'blue'
}

if you want to get the value of favoriteFood, normally you could do either obj.favoriteFood or obj['favoriteFood']
let's say you want to get different values at different times using a variable var favoriteThing = 'favoriteFood';
in that case you must use brackets: obj[favoriteThing]

Darren
@DarrenfJ
Aug 07 2017 15:13 UTC
using a varable is sometimes used when the object property is more of a string "like this" and you want to use dot notation for a say an object that has an object in it or something,, where you need to do object.firstThing.secondThing or something like that.. if .firstThing is actually using a variable var firstThing = "like this" then you don't have to do object["like this'].secondThing.. or something like that
@gilalexandel ^^
hey thanks for the quicker and easier answer ;) thanks @Margaret2
CamperBot
@camperbot
Aug 07 2017 15:15 UTC
darrenfj sends brownie points to @margaret2 :sparkles: :thumbsup: :sparkles:
:star2: 2871 | @margaret2 |http://www.freecodecamp.com/margaret2
Margaret
@Margaret2
Aug 07 2017 15:15 UTC
lol thx for your answer too :smile: @DarrenfJ
?
ty @DarrenfJ
CamperBot
@camperbot
Aug 07 2017 15:16 UTC
margaret2 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1953 | @darrenfj |http://www.freecodecamp.com/darrenfj
Margaret
@Margaret2
Aug 07 2017 15:16 UTC
there we go
Darren
@DarrenfJ
Aug 07 2017 15:17 UTC
:D
@gilalexandel I'll often use a variable if it one of those multi layered objects with objects inside array inside the main object..
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:18 UTC

The bracket notation use ultra helpful in 2 cases.

1) Your keys have special characters in it. Example

var obj = {
  key:'value'
  '@value':'value Two',
  'val-ue':'value Three'
}

How will I get values value Two and value Three ?

you can't do obj.val-ue coz that's syntax error
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:19 UTC
Can someone help me please? I want to put a background on my web page.
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:19 UTC
you can't do obj.@value as it is, again, syntax error
however, you can do obj['val-ue'] and obj['@value']
Gil Alexandel
@gilalexandel
Aug 07 2017 15:20 UTC
@Margaret2 Thanks you, i get it now but not fully.
CamperBot
@camperbot
Aug 07 2017 15:20 UTC
gilalexandel sends brownie points to @margaret2 :sparkles: :thumbsup: :sparkles:
:star2: 2872 | @margaret2 |http://www.freecodecamp.com/margaret2
Darren
@DarrenfJ
Aug 07 2017 15:20 UTC
@AdiSkywalker thanks
and hi too! :D
thanks @AdiSkywalker
CamperBot
@camperbot
Aug 07 2017 15:20 UTC
darrenfj sends brownie points to @adiskywalker :sparkles: :thumbsup: :sparkles:
:cookie: 354 | @adiskywalker |http://www.freecodecamp.com/adiskywalker
Gil Alexandel
@gilalexandel
Aug 07 2017 15:20 UTC
@DarrenfJ Yours Something like that confuse me , LOL
Darren
@DarrenfJ
Aug 07 2017 15:20 UTC
camperbots being finickey
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:21 UTC
Second use case is, when your key name is stored in another variable. Consider this function, which gives you value for key that is passed in as a parameter.
function getValue(key){
  const obj = {
    name: 'Some name',
    id: 5
  }
}
Gil Alexandel
@gilalexandel
Aug 07 2017 15:21 UTC
Maybe my understanding on english.
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:21 UTC
and you call it as getValue('name')
if, in your getValue function, you do return obj.key it will be undefined
as there is no property called key in obj
key is a variable that contains key.
So you need to do return obj[key]
and you will get correct value
Darren
@DarrenfJ
Aug 07 2017 15:22 UTC
@gilalexandel I think the thing to take away form it is if you need to due to some limitations, set a variable or the object key and use it instead of the actual variable.. .then if you need to somewhere else in the program, change the value of that variable rather than the place where you call the objects properties.
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:22 UTC
Someone help me please
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:22 UTC
@Manpee Whats your question?
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:23 UTC
@AdiSkywalker I want to add a background to my web page, please how do i do that?
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:24 UTC
@Manpee you got codepen or something
Darren
@DarrenfJ
Aug 07 2017 15:24 UTC
brb :coffee:
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:24 UTC
basically you need to use background-image property in CSS
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:26 UTC
@AdiSkywalker yes on codepen. I am building a Personal Portfolio Webpage
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:26 UTC
@Manpee send me the link
Gil Alexandel
@gilalexandel
Aug 07 2017 15:27 UTC
@AdiSkywalker Thanks for your explanation
CamperBot
@camperbot
Aug 07 2017 15:27 UTC
gilalexandel sends brownie points to @adiskywalker :sparkles: :thumbsup: :sparkles:
:cookie: 355 | @adiskywalker |http://www.freecodecamp.com/adiskywalker
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:27 UTC
@AdiSkywalker which link? is it my codepen link?
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:28 UTC
of course codepen :laughing: @Manpee
@gilalexandel :+1:
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:28 UTC
@AdiSkywalker dont mind the content. I am trying to edit the last assignment page
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:29 UTC
@Manpee now
1) What image do you want ?
2) Where do you want it?
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:31 UTC
@AdiSkywalker I want an image of a stadium to be the background of the page covering the whole background
Darth Skywalker
@AdiSkywalker
Aug 07 2017 15:32 UTC
@Manpee okay
just give me that image
url, I mean
Nnenanya Chinedu
@Manpee
Aug 07 2017 15:34 UTC
@AdiSkywalker brb
mbsyaswanth
@mbsyaswanth
Aug 07 2017 16:19 UTC
Where is JavaScript official documentation ? I want to use js in building web pages..
Keith
@7KAG7
Aug 07 2017 16:25 UTC
so i have this script on my weather app project and its just showing loading in the bottom, any suggestions
  var long;
  var lat;
  var temp;
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {

      long = position.coords.longitude;
      lat = position.coords.latitude;


  //create api with geolocation 
  var api = "https://api.openweathermap.org/data/2.5/weather?id= ChIJQwHH1RoM5IkRVvrMAKJW0d0&appid=AIzaSyCcS9Sd2jqrhX6auXHiEGqkHE96HPA3A_0";

      $.getJSON(api, function(data){
    //JSON call for open weather api
    var weatherType = data.weather[0].description;
    var kelvin = data.main.temp;
    var windSpeed = data.ein.speed;
    var city = data.name;

      console.log(city);
    console.log(api);

  });

  });

  }
Raj Patel
@rajp1847
Aug 07 2017 16:57 UTC
help plz
Ryan Draves
@RyanDraves
Aug 07 2017 17:01 UTC
@dudeguykid I'm not seeing you use lat or long in your api call
@rajp1847 whatcha need?
anyone here that can help with a React problem? I'm not understanding why a prop isn't passing down correctly
Anthony DeSordi
@desordi3
Aug 07 2017 17:07 UTC
Can someone help break down javascript remainder for me? having trouble wrapping my head around it
Anthony DeSordi
@desordi3
Aug 07 2017 17:16 UTC
scratch that, got it
Mukesh Kumar Angrish
@MukeshAngrish
Aug 07 2017 17:59 UTC
Screen Shot 2017-08-07 at 11.27.12 PM.png
Barbara
@barb1643
Aug 07 2017 18:00 UTC

Can someone help me with some jquery/bootstrap? I have a modal that is working locally but after upload it won't work. This is the script:<script>
$('#myModal').modal({show: false});

$(window).load('#myModal',function(){
setTimeout(function(){
$('#myModal').modal('show');
}, 5000);

});
$('#mymodal').modal('hide');
</script>

Moisés Man
@moigithub
Aug 07 2017 18:21 UTC
instead of window.load try $(document).ready ?
http://api.jquery.com/load-event/ says is deprecated.. and removed on version 3.
unless im checking wrong link ? :P
Barbara
@barb1643
Aug 07 2017 18:25 UTC
I changed it to your suggestion and it got rid of my error: Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined but the modal is still not appearing.
This is very confusing, I've been trying to find an answer to this for days!!
Joseph
@revisualize
Aug 07 2017 20:03 UTC
Hello.
Pethaf
@Pethaf
Aug 07 2017 20:17 UTC
@barb1643 Have you tried debugging the script line by line?
Does $("#myModal") actually return an element?
Luke Miller
@dalumiller
Aug 07 2017 20:25 UTC
Hey, I have a few styling changes to make, but wanted any feedback if you don't mind taking a second. Thanks! https://codepen.io/dalumiller/full/rzMeaw/
Lauri Välja
@OFFLlNE
Aug 07 2017 20:32 UTC
@dalumiller would be nice to have a container. Also add some styling to the section, so I would understand if I am looking at "all", "online" etc.
Luke Miller
@dalumiller
Aug 07 2017 20:33 UTC
@OFFLlNE a container instead of a table?
@OFFLlNE good idea about the styling for "what am I looking at?'
Lauri Välja
@OFFLlNE
Aug 07 2017 20:34 UTC
well anything, just to see the list separate from other things
borders etc. A table as you mention could do the job totally
Luke Miller
@dalumiller
Aug 07 2017 20:37 UTC
ok, thanks @OFFLlNE
CamperBot
@camperbot
Aug 07 2017 20:37 UTC
dalumiller sends brownie points to @offllne :sparkles: :thumbsup: :sparkles:
:star2: 1061 | @offllne |http://www.freecodecamp.com/offllne
Lauri Välja
@OFFLlNE
Aug 07 2017 20:37 UTC
;) It you want to make it fancy, you could make a fade / slide effect to display those, but this is not really needed there :p
Albert Cardona II
@daddycardona
Aug 07 2017 20:58 UTC
hello brothers and sisters, how are you all?
quick question, I am using this code
```
if(anotherArr2.indexOf(anotherArr[i]) !== null ){
newArr.push(anotherArr[i]);
}
  if(anotherArr2.indexOf(anotherArr[i]) !== null ){
            newArr.push(anotherArr[i]);
        }
how come it still produces a null value, I also tried != null
Lauri Välja
@OFFLlNE
Aug 07 2017 21:02 UTC
can you show your arrays?
Manish Giri
@Manish-Giri
Aug 07 2017 21:03 UTC
@daddycardona try !== -1
indexOf won't return a null
it will return -1 if the item is not present
Albert Cardona II
@daddycardona
Aug 07 2017 21:04 UTC
Oh I am sorry let me show you the whole code
Lauri Välja
@OFFLlNE
Aug 07 2017 21:04 UTC
well Manish pretty much explained the problem :D Not as patient as I was trying to be
Manish Giri
@Manish-Giri
Aug 07 2017 21:04 UTC
haha
hola @OFFLlNE
how goes it
Albert Cardona II
@daddycardona
Aug 07 2017 21:05 UTC
function diffArray(arr1, arr2) {
  var newArr = [];
  var more ;
  var anotherArr=[];
  var anotherArr2=[];
  if(arr1.length>arr2.length){
      more=arr1.length;
      anotherArr = arr1;
      anotherArr2 = arr2;
  }
  else{
    more=arr2.length;
    anotherArr=arr2;
    anotherArr2 = arr1;
  }
  for(var i =0;i<more;i++){
      if(anotherArr.indexOf(anotherArr2[i]) === -1){
        if(anotherArr.indexOf(anotherArr2[i]) !== null ){
            newArr.push(anotherArr2[i]);
        }
    }else if(anotherArr2.indexOf(anotherArr[i]) === -1){
      if(anotherArr2.indexOf(anotherArr[i]) !== null ){
            newArr.push(anotherArr[i]);
        }
    }


  }

  // Same, same; but different.
  return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Lauri Välja
@OFFLlNE
Aug 07 2017 21:05 UTC
@Manish-Giri difficult life :D Lack of motivation because of work. But otherwise seems cool and chill. Loving the work environment
Missing this place a bit :D
Albert Cardona II
@daddycardona
Aug 07 2017 21:06 UTC
@Manish-Giri so I have used the -1 without the inner if statement but I keep getting the null value
Lauri Välja
@OFFLlNE
Aug 07 2017 21:07 UTC
what are you trying to do? @daddycardona
Albert Cardona II
@daddycardona
Aug 07 2017 21:08 UTC

Compare two arrays and return a new array with any items only found in one of the two given arrays, but not both. In other words, return the symmetric difference of the two arrays.

Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code

Diff Two Arrays
that is the name of the lesson I am on @OFFLlNE
Lauri Välja
@OFFLlNE
Aug 07 2017 21:11 UTC
how I would approach this: Take 1st element of Arr1, compare to that to all elements in Arr2, if none match, then add it to newArr. And then the 2nd element of Arr1, compare to all of Arr2 and if none match, then add to newArr. Then loop through arr2. But that is my initial idea. Too sleepy to dive into your logic
Heading to bed, think @Manish-Giri can help you out with this :D
stealthygame
@stealthygame
Aug 07 2017 21:11 UTC
is it too "weird" to make the calculator web page in Bootstrap form ?
Albert Cardona II
@daddycardona
Aug 07 2017 21:15 UTC
@thekholm80 I would look into this, and @OFFLlNE I thought that was what i was doing
Kyle Holm
@thekholm80
Aug 07 2017 21:16 UTC
@daddycardona i believe one of the Help room regulars used the include() method for a oneliner solution to that problem
Albert Cardona II
@daddycardona
Aug 07 2017 21:17 UTC
@thekholm80 I bet you already did this in one line LOL
just now lol
Manish Giri
@Manish-Giri
Aug 07 2017 21:18 UTC
He did it in 0.5 line
One line is a bit too much
Albert Cardona II
@daddycardona
Aug 07 2017 21:19 UTC
All you geniuses with your one liners lol
Kyle Holm
@thekholm80
Aug 07 2017 21:19 UTC
actually i just scribbled it in the margins
so 0 lines
Albert Cardona II
@daddycardona
Aug 07 2017 21:19 UTC
LMAO
Albert Cardona II
@daddycardona
Aug 07 2017 21:26 UTC
I just don't understand why the !== null don't stop it?
Albert Cardona II
@daddycardona
Aug 07 2017 21:34 UTC
I got the not null part fixed with if(anotherArr2[i] != null) and got rid of the the else :) and it works I am such a genious like you guys thanks @OFFLlNE that little knowledge you was talking about just sank in ;)
CamperBot
@camperbot
Aug 07 2017 21:34 UTC
daddycardona sends brownie points to @offllne :sparkles: :thumbsup: :sparkles:
:star2: 1062 | @offllne |http://www.freecodecamp.com/offllne
Kyle Holm
@thekholm80
Aug 07 2017 21:35 UTC
@daddycardona none of us started where we are now, it took practice
Albert Cardona II
@daddycardona
Aug 07 2017 21:35 UTC
thanks @thekholm80 that read is a good one and here is my updated code :)
function diffArray(arr1, arr2) {
  var newArr = [];
  var more ;
  var anotherArr=arr1;
  var anotherArr2=arr2;


        if(arr1.length>arr2.length){
            more=arr1.length;
        }else{
          more=arr2.length;
        }


  for(var i =0;i<more;i++){
      if(anotherArr.indexOf(anotherArr2[i]) === -1){

          if(anotherArr2[i] != null)  {
            newArr.push(anotherArr2[i]);
          }

    }
    if(anotherArr2.indexOf(anotherArr[i]) === -1){
      if(anotherArr[i] != null ){
            newArr.push(anotherArr[i]);
        }
    }


  }

  // Same, same; but different.
  return newArr;
}

diffArray([1, "calf", 3, "piglet"], [1, "calf", 3, 4]);
CamperBot
@camperbot
Aug 07 2017 21:35 UTC
daddycardona sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1431 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Albert Cardona II
@daddycardona
Aug 07 2017 21:45 UTC
@thekholm80 I should of been just as good or better than a lot of people here but I was lazy, I have been studying this for a long time just not the properway.
Kyle Holm
@thekholm80
Aug 07 2017 21:46 UTC
what's the proper way?
Nnenanya Chinedu
@Manpee
Aug 07 2017 21:51 UTC
Please who can help me on background image???
I need to add background image to my web page, please who can assist me/
Sydney
@SydneyWarren
Aug 07 2017 21:54 UTC
function steamrollArray(arr) {
  // I'm a steamroller, baby
   var merged = [].concat.apply([], arr);
  console.log(arr);
  console.log(merged);
  return arr;
}

steamrollArray([1, [2],[3, [[4]]]]);
can someone tell me why the arr isn't all the way flattened
Nnenanya Chinedu
@Manpee
Aug 07 2017 21:55 UTC
I need to add background image to my web page, please who can assist me?
Manish Giri
@Manish-Giri
Aug 07 2017 21:56 UTC
@Manpee use background-image
Nnenanya Chinedu
@Manpee
Aug 07 2017 21:57 UTC
@Manish-Giri please can you show me how to use it
Manish Giri
@Manish-Giri
Aug 07 2017 21:58 UTC
@Manpee
div {
background-image: url('link-to-your-image');
}
Nnenanya Chinedu
@Manpee
Aug 07 2017 22:01 UTC
@Manish-Giri is it going to be inside style?
Manish Giri
@Manish-Giri
Aug 07 2017 22:01 UTC
yup
all css goes inside style tags
or else in a separate .css file
Nnenanya Chinedu
@Manpee
Aug 07 2017 22:13 UTC
@Manish-Giri ok thanks, i have gotten it. Although i used "body" instead of "div". Thanks a lot!!!
CamperBot
@camperbot
Aug 07 2017 22:13 UTC
manpee sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
Sydney
@SydneyWarren
Aug 07 2017 22:13 UTC
i found out the syntax to flatten it but there has to be a better way
CamperBot
@camperbot
Aug 07 2017 22:13 UTC
:star2: 6381 | @manish-giri |http://www.freecodecamp.com/manish-giri
Sydney
@SydneyWarren
Aug 07 2017 22:13 UTC
function steamrollArray(arr) {
  // I'm a steamroller, baby
   var merged = [].concat.apply([], arr);
   var merged2 = [].concat.apply([], merged);
   var merged3 = [].concat.apply([], merged2);
  console.log(arr);
  console.log(merged);
  console.log(merged2);
  console.log(merged3);
  return arr;
}
any suggestion to make instead of repeating it
Manish Giri
@Manish-Giri
Aug 07 2017 22:18 UTC
Use recursion
Sydney
@SydneyWarren
Aug 07 2017 22:18 UTC
whats recursion?
Manish Giri
@Manish-Giri
Aug 07 2017 22:18 UTC
Anytime you find you're repeating similar lines of code
Is a good hint that something's off
Recursion is a function that calls itself
Mike Batista
@mbmontana
Aug 07 2017 22:18 UTC
Does any one have any hints, without giving away the solution, on the JavaScript "Word Blanks" challenge?
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");
Brianna
@brisourceful
Aug 07 2017 22:26 UTC
anyone familiar with Nodemailer??? I'm trying to make a contact form and I want to avoid PHP at all costs.
Kyle Holm
@thekholm80
Aug 07 2017 22:26 UTC
PHP is life
Brianna
@brisourceful
Aug 07 2017 22:26 UTC
PHP can go suck a nut
Kyle Holm
@thekholm80
Aug 07 2017 22:27 UTC
young lady do you kiss your mother with that mouth?
Brianna
@brisourceful
Aug 07 2017 22:27 UTC
why on earth would I kiss my mother??
Kyle Holm
@thekholm80
Aug 07 2017 22:27 UTC
lol no clue
Brianna
@brisourceful
Aug 07 2017 22:27 UTC
lol
Kyle Holm
@thekholm80
Aug 07 2017 22:27 UTC
the docs for nodemailer look pretty good
actually they look awesome
Brianna
@brisourceful
Aug 07 2017 22:28 UTC
they are decent but what i'm having troubles figuring out is how I connect the input from the contact form with the transporter
Kyle Holm
@thekholm80
Aug 07 2017 22:29 UTC
pure node or express?
Brianna
@brisourceful
Aug 07 2017 22:29 UTC
node and express
Kyle Holm
@thekholm80
Aug 07 2017 22:29 UTC
are you using body-parser?
Brianna
@brisourceful
Aug 07 2017 22:29 UTC
no....
should I?
Kyle Holm
@thekholm80
Aug 07 2017 22:29 UTC
it's middleware that will take the body of your form's post request and parse it into request.body so you can access it
Manish Giri
@Manish-Giri
Aug 07 2017 22:30 UTC
Oh hey Brianna is back
:wave:
Kyle Holm
@thekholm80
Aug 07 2017 22:30 UTC
she wants some PHP lessons @Manish-Giri
Manish Giri
@Manish-Giri
Aug 07 2017 22:31 UTC
What's php
Brianna
@brisourceful
Aug 07 2017 22:31 UTC
hey @Manish-Giri :)
Manish Giri
@Manish-Giri
Aug 07 2017 22:31 UTC
Post hyper pressure
Brianna
@brisourceful
Aug 07 2017 22:31 UTC
ahhhh maybe that's what I'm missing
Kyle Holm
@thekholm80
Aug 07 2017 22:31 UTC
it's pretty straight forward to use
__mifflin__
@cdrainxv
Aug 07 2017 22:31 UTC
PHP?
Brianna
@brisourceful
Aug 07 2017 22:31 UTC
yeah it seems straight forward but I'm sure I'm over complicating it
Kyle Holm
@thekholm80
Aug 07 2017 22:32 UTC
i'd mock up a demo for you, but i'm kind of buried right now
__mifflin__
@cdrainxv
Aug 07 2017 22:33 UTC
@mbmontana: Well from previous lessions you learned how to concat strings to form a sentence. It’s the same principle here… you just create a string using with the parameters provided.
Brianna
@brisourceful
Aug 07 2017 22:33 UTC
well unbury yourself, Kyle. What are you waiting for? lol
Kyle Holm
@thekholm80
Aug 07 2017 22:34 UTC
lol
Brianna
@brisourceful
Aug 07 2017 22:34 UTC
I found a demo but it was using React which screwed me up. I just made a simple contact form in HTML and then trying have it send me the user's message to my gmail.
Kyle Holm
@thekholm80
Aug 07 2017 22:35 UTC
fine one sec, i'll make something
Brianna
@brisourceful
Aug 07 2017 22:35 UTC
Yay!!! :clap: :100:
__mifflin__
@cdrainxv
Aug 07 2017 22:36 UTC

well unbury yourself, Kyle. What are you waiting for? lol

You’ve never watched Kill Bill Vol. II? It’s pretty easy by the looks of it.

Kyle Holm
@thekholm80
Aug 07 2017 22:37 UTC
i'm still working on wiggling my big toe, i haven't got to the advanced unbury yourself lessons yet
Brianna
@brisourceful
Aug 07 2017 22:42 UTC
I can teach you young Padawan
__mifflin__
@cdrainxv
Aug 07 2017 22:42 UTC
I need a bit of refresher every now and then as well… but lately I’ve been stuck in this loop of watching Groundhog Day…. and let’s just say… I’m pretty good at piano now. :smile:
Brianna
@brisourceful
Aug 07 2017 22:43 UTC
:joy:
Manish Giri
@Manish-Giri
Aug 07 2017 22:50 UTC
fine one sec, i'll make something
he never makes demos for me
:unamused:
there you go
@brisourceful oh crap, if you don't have nodemon installed, change the package.json start script to "start": "node server.js"
Brianna
@brisourceful
Aug 07 2017 22:53 UTC
I have nodemon ;)
You're the best @thekholm80 thank you!!
CamperBot
@camperbot
Aug 07 2017 22:53 UTC
brisourceful sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1432 | @thekholm80 |http://www.freecodecamp.com/thekholm80
Brianna
@brisourceful
Aug 07 2017 22:53 UTC
@Manish-Giri I guess you know where your friendship stands with Kyle lol
Kyle Holm
@thekholm80
Aug 07 2017 22:54 UTC

@Manish-Giri then who did i make this for? https://github.com/thekholm80/basic_mern_example

he never makes demos for me

jerk doesn't appreciate anything
:P
Brianna
@brisourceful
Aug 07 2017 22:56 UTC
LOL :fire:
__mifflin__
@cdrainxv
Aug 07 2017 23:00 UTC
package-lock.json? I would have pegged you for a yarn man.
Kyle Holm
@thekholm80
Aug 07 2017 23:00 UTC
never tried yarn
npm is all i know
well, and apt but that's a little different
__mifflin__
@cdrainxv
Aug 07 2017 23:05 UTC
Whenever I learn a new language I try out a new editor… and for php and python I’ve been using vim … and it’s amazing!!! I love living in an iterm world! Alas, I have atom set up so perfectly for js…

well, and apt but that's a little different

Yeah… I miss linux… sometimes… might partition off a little bit of my drive once again.


Might even use emacs next, just so I can take a side in the vim vs emacs wars. :smile:
Kyle Holm
@thekholm80
Aug 07 2017 23:11 UTC
that's a good idea. @Manish-Giri talked me into trying out python, maybe i'll get a new editor just for python while i'm at it
IggySmith
@IggySmith
Aug 07 2017 23:13 UTC
help.. why am i getting an error for my closing bracket? it is expecting a semi colon
image.png
Gersho
@Gersho
Aug 07 2017 23:14 UTC
@IggySmith for i must use ; as separator not ,
for (i=0;
IggySmith
@IggySmith
Aug 07 2017 23:14 UTC
@Gersho thanks
CamperBot
@camperbot
Aug 07 2017 23:14 UTC
iggysmith sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @gersho |http://www.freecodecamp.com/gersho
Tom
@tpeskie
Aug 07 2017 23:52 UTC
I can't get the weather icon to show up. Literally everything else will pull from the API. Help!