These are chat archives for FreeCodeCamp/HelpFrontEnd

11th
Aug 2017
juni
@junipberry
Aug 11 2017 00:11
@SkyC0der but it does exist.. given in the var customerData object above
Gulsvi
@gulsvi
Aug 11 2017 00:16
@junipberry There is no "name" property in the customerData object
var customerData = {
  name: 
}
juni
@junipberry
Aug 11 2017 00:16
but its defined below function
with Object.keys
Gulsvi
@gulsvi
Aug 11 2017 00:17
Okay, I see that now
That shouldn't be necessary since they give you firstName, the name you need to look up
juni
@junipberry
Aug 11 2017 00:17
but thats an object
I turned it into an array
Gulsvi
@gulsvi
Aug 11 2017 00:18
Yeah, I see that and then you loop through the array to see if any of those names match firstName
juni
@junipberry
Aug 11 2017 00:18
yup
Gulsvi
@gulsvi
Aug 11 2017 00:18
why not just do customerData[firstName] ?
and customerData[firstName].visits to check the number of visits?
juni
@junipberry
Aug 11 2017 00:19
I did do that initially
but changed it up
Gulsvi
@gulsvi
Aug 11 2017 00:19
If you do that, there's no need to create an array or a loop
You can solve the problem by checking if customerData.hasOwnProperty(firstName) and checking the visits with: customerData[firstName].visits
juni
@junipberry
Aug 11 2017 00:21
okay, that is another way about it. Can you help me figure out how to fix it this way.
Gulsvi
@gulsvi
Aug 11 2017 00:21
The main issue in your code will be customerData.visits[i]
juni
@junipberry
Aug 11 2017 00:22
why is that an issue
Gulsvi
@gulsvi
Aug 11 2017 00:22
because the visits property is part of the name object
juni
@junipberry
Aug 11 2017 00:29
so I should not have done a loop in the first place?
Gulsvi
@gulsvi
Aug 11 2017 00:30
The loop isn't necessary, but I can help you make your code work
juni
@junipberry
Aug 11 2017 00:30
did I make it more complicated than it should have
Gulsvi
@gulsvi
Aug 11 2017 00:30
Yes
juni
@junipberry
Aug 11 2017 00:30
ahh
I started w two loops initially
set up an if/else if for values
then pushed in the names.. or tried to
thats where I got into trouble
then I got help on the names part where it was suggested I set up variable for names
Gulsvi
@gulsvi
Aug 11 2017 00:31
Ahh, I see
There's a simpler way to do it
juni
@junipberry
Aug 11 2017 00:32
the whole thing got so convoluted
ahh simple is good
Ill do it that way
cleaning up my code now..
Gulsvi
@gulsvi
Aug 11 2017 00:32
Just check if customerData.hasOwnProperty(firstName) is equal to firstName
if it is, check the number of visits with customerData[firstName].visits
The rest is just if/else and return the greeting
juni
@junipberry
Aug 11 2017 00:35
var customerData = {
  'Joe': {
    visits: 1
  },
  'Carol': {
    visits: 2
  },
  'Howard': {
    visits: 3,
  },
  'Carrie': {
    visits: 4
  }
};

function greetCustomer(firstName) {
  var greeting = '';

   if (customerData.hasOwnProperty(firstName)==firstName) {
   if (customerData.visits>1){
     greeting= ("Welcome back," + firstName + "! So glad to see you again!");
   }
   else if (customerData.visits==1){
     greeting= ("Welcome back," + firstName + "! We're glad you liked us the first time!");
   }
   }
   else {
     greeting= ("Welcome! Is this your first time?");
 }
    return greeting;
Gulsvi
@gulsvi
Aug 11 2017 00:37
@junipberry To get the number of visits, use customerData[firstName].visits
Also, hasOwnProperty returns true or false
(it can't be equal to firstName unless firstName is actually the value true or false)
juni
@junipberry
Aug 11 2017 00:42
okay, changing it~
btw, if I do customerData[firstName].visits doesn’t that mean firstName is an array instead of object?
Gulsvi
@gulsvi
Aug 11 2017 00:43
No, we use [brackets] like that when accessing objects with a variable
juni
@junipberry
Aug 11 2017 00:45
oh right
function greetCustomer(firstName) {
  var greeting = '';

   if (customerData.hasOwnProperty(firstName)) {
   if (customerData[firstName].visits>=2){
     greeting= ("Welcome back," + firstName + "! So glad to see you again!");
   }
   else if (customerData[firstName].visits==1){
     greeting= ("Welcome back," + firstName + "! We're glad you liked us the first time!");
   }
   }
   else {
     greeting= ("Welcome! Is this your first time?");
 }
    return greeting;
Gulsvi
@gulsvi
Aug 11 2017 00:48
That should work ^^
(you might need a space after the comma though)
juni
@junipberry
Aug 11 2017 00:52
wow that is so much simpler
you were the only one to point out I didnt need a loop at all
ty so much @SkyC0der
CamperBot
@camperbot
Aug 11 2017 00:53
junipberry sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2358 | @skyc0der |http://www.freecodecamp.com/skyc0der
juni
@junipberry
Aug 11 2017 00:53
took away all the confusion
Gulsvi
@gulsvi
Aug 11 2017 00:54
@junipberry Any time. This is what your original answer would be like, for comparison:
function greetCustomer(firstName) {
  let names = Object.keys(customerData);

  for (i = 0; i < names.length; i++) {
    if (names[i] === firstName) {
      if (customerData[names[i]].visits > 1) {
        return "Welcome back, " + firstName + "! So glad to see you again!";
      } else if (customerData[names[i]].visits == 1) {
        return "Welcome back, " + firstName + "! We're glad you liked us the first time!";
      }
    } else {
      return "Welcome! Is this your first time?";
    }
  }
}
juni
@junipberry
Aug 11 2017 00:58
That is very generous of you to make that, I’m looking through it now
and it helps a ton
TY! @SkyC0der
CamperBot
@camperbot
Aug 11 2017 00:58
junipberry sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:warning: junipberry already gave skyc0der points
李富全
@Mr-Li-admin
Aug 11 2017 01:02
@longnt80 I fined it,because i used the chinese version of Fcc
I fined the English version of Fcc
Gulsvi
@gulsvi
Aug 11 2017 01:09
No problem - helps me too by comparing the two
iso
@iso1048
Aug 11 2017 01:59
@SkyC0der you on bro?
Gulsvi
@gulsvi
Aug 11 2017 02:00
yeah bro
Ccs99817
@ccs99817
Aug 11 2017 02:00

I need help with the Wherefore art thou


function whatIsInAName(collection, source) {
  // What's in a name?
  var firstRoundArr = [];
  var secondRoundArr = [];
  // Only change code below this line
  //************************************/
  // generate a set of keys
  var keysSet = Object.keys(source);

  //generate a set of values
  var valuesSet = Object.values(source);

  //test for object in collectionthat has all the key required 1-round-filter
  for (var i=0; i<collection.length; i++){
    var match = false;
    for (var j=0; j<keysSet; j++){
      match = collection[i].hasOwnProperty(keysSet[j]); 
    }
    if(match){
      firstRoundArr.push(collection[i]);
    }
  }
  //test the passed object if the values matches


  //************************************/
  // Only change code above this line
  return firstRoundArr;
}

whatIsInAName([{ "a": 1, "b": 2 }, 
                { "a": 1 }, 
                { "a": 1, "b": 2, "c": 2 }], { "a": 1, "b": 2 });

I found a bug in line 15 to line 24.
I try to change the value of the boolean "match" by the return value in line 18;
But, I dunno why it didn't work.

iso
@iso1048
Aug 11 2017 02:01
@SkyC0der what do you reckon is the best way to split a string with a length of around 100 into strings with a length of 3?
Ccs99817
@ccs99817
Aug 11 2017 02:01

Can anyone help me? I have posted it in other group, but nobody replies

I need help with the Wherefore art thou


function whatIsInAName(collection, source) {
  // What's in a name?
  var firstRoundArr = [];
  var secondRoundArr = [];
  // Only change code below this line
  //************************************/
  // generate a set of keys
  var keysSet = Object.keys(source);

  //generate a set of values
  var valuesSet = Object.values(source);

  //test for object in collectionthat has all the key required 1-round-filter
  for (var i=0; i<collection.length; i++){
    var match = false;
    for (var j=0; j<keysSet; j++){
      match = collection[i].hasOwnProperty(keysSet[j]); 
    }
    if(match){
      firstRoundArr.push(collection[i]);
    }
  }
  //test the passed object if the values matches


  //************************************/
  // Only change code above this line
  return firstRoundArr;
}

whatIsInAName([{ "a": 1, "b": 2 }, 
                { "a": 1 }, 
                { "a": 1, "b": 2, "c": 2 }], { "a": 1, "b": 2 });

I found a bug in line 15 to line 24.
I try to change the value of the boolean "match" by the return value in line 18;
But, I dunno why it didn't work.

CallMeOrange
@EgnaroDev
Aug 11 2017 02:03
@gothamknight lol, I know you didn't ask me but it is really good question...
Is this a challenge somewhere?
Gulsvi
@gulsvi
Aug 11 2017 02:03
@gothamknight I thought you just wanted to know how I was doing lol
CallMeOrange
@EgnaroDev
Aug 11 2017 02:03
lol
iso
@iso1048
Aug 11 2017 02:03
@SkyC0der that too bro haha
@EgnaroDev nah starting a personal project. Just in idea stage at the moment though
Gulsvi
@gulsvi
Aug 11 2017 02:04
lol, I'd just split it an loop through it, but not sure if that's "the best" way
CallMeOrange
@EgnaroDev
Aug 11 2017 02:04
Oh
iso
@iso1048
Aug 11 2017 02:04
oh yeah. just wondering if you knew any 'secret' methods as you usually do
CallMeOrange
@EgnaroDev
Aug 11 2017 02:06
Hm... I don't really understand your question, you want to split a string with a length of 100 then add that numbers into "100"?
if a split string has 100 length then return "100"?
iso
@iso1048
Aug 11 2017 02:07
@EgnaroDev nah bro. so if the given string was e.g. "abcabcabcabcabcabcabcabc......", i want to make an array like: ["abc", "abc",.....]
CallMeOrange
@EgnaroDev
Aug 11 2017 02:08
I see
I think you can use .match()
it depends on a string tho
iso
@iso1048
Aug 11 2017 02:09
nah cant use .match()
CallMeOrange
@EgnaroDev
Aug 11 2017 02:09
dang
function test(str){
  return str.match(/abc/g);
}
test("abcabcabcabcabcabcabcabc"); // [ 'abc', 'abc', 'abc', 'abc', 'abc', 'abc', 'abc', 'abc' ]
iso
@iso1048
Aug 11 2017 02:10
shit does that actually work...
CallMeOrange
@EgnaroDev
Aug 11 2017 02:10
lol yeah
have you ever use .match() before?
iso
@iso1048
Aug 11 2017 02:10
nah i havent.
CallMeOrange
@EgnaroDev
Aug 11 2017 02:10
oh :/
iso
@iso1048
Aug 11 2017 02:10
but nah still cant use it
since the initial string will be variable
CallMeOrange
@EgnaroDev
Aug 11 2017 02:11
Hm.. is this just your idea or a challenge somewhere? it looks like a codewar challenge
Jesus Carrillo
@91integ25
Aug 11 2017 02:11
@ccs99817 the second inner loop only sets the value of match to the last value in the array so that might be why it is not working If I am looking at it correctly you want to place the if statement within the second for loop to check every value.
iso
@iso1048
Aug 11 2017 02:11
@EgnaroDev just my idea. it has been done many times though
CallMeOrange
@EgnaroDev
Aug 11 2017 02:11
I see
iso
@iso1048
Aug 11 2017 02:11
so not an original idea
CallMeOrange
@EgnaroDev
Aug 11 2017 02:12
What is an example of this variable? not sure what you mean by initial string
iso
@iso1048
Aug 11 2017 02:12
@EgnaroDev all good bro, i want to figure it out for myself. what level are you in at school?
Gulsvi
@gulsvi
Aug 11 2017 02:13

The loop idea is like:

for(var i = 0; i < str.length-3; i+=3) {
  answer.push(str[i] + str[i+1] + str[i+2]);
}

the .match() could work nicely if you modify the regex to work for any string

I'd have to test that out though...
iso
@iso1048
Aug 11 2017 02:14
yeah i need to learn regex haha
@SkyC0der your for loop works very well
Gulsvi
@gulsvi
Aug 11 2017 02:15
str.match(/.{3}/g)
^^ That's so much more concise :)
match any 3 characters, globally
CallMeOrange
@EgnaroDev
Aug 11 2017 02:16
@gothamknight wait you didn't want to search for abc then add them in an array?
iso
@iso1048
Aug 11 2017 02:16
@EgnaroDev abc was just an example of the string bro.
Gulsvi
@gulsvi
Aug 11 2017 02:16
This was my test string :joy:
var str = "This is my really longggg string that is around one hundred characters long. I think it's that long."
CallMeOrange
@EgnaroDev
Aug 11 2017 02:17
"abcdcbger" => "['abc', 'dcb', 'ger ']"
Like that?
@SkyC0der lol
iso
@iso1048
Aug 11 2017 02:17
@SkyC0der king of efficiency
CallMeOrange
@EgnaroDev
Aug 11 2017 02:17
at first, I thought that string is a part of codewars' challenge
Gulsvi
@gulsvi
Aug 11 2017 02:18
I had to add some gs to the end of long to make it 100 characters
CallMeOrange
@EgnaroDev
Aug 11 2017 02:18
what level are you in at school?
Like grade?
iso
@iso1048
Aug 11 2017 02:18
@EgnaroDev or maybe you are
@EgnaroDev yeah bro
CallMeOrange
@EgnaroDev
Aug 11 2017 02:18
Oh, I'm Junior, lol first time I wrote "Junior" I feel like I'm not junior..
3rd years
@SkyC0der Hey, found any good challenge of codewars?
Gulsvi
@gulsvi
Aug 11 2017 02:20
@EgnaroDev I did a fun one earlier today - let me get the link
CallMeOrange
@EgnaroDev
Aug 11 2017 02:20
Sure
iso
@iso1048
Aug 11 2017 02:20
@EgnaroDev so how many years left of high school?
CallMeOrange
@EgnaroDev
Aug 11 2017 02:20
2 years left I think, 4 years is a limit for high school in US (up to 18 years old...)
Ccs99817
@ccs99817
Aug 11 2017 02:21
@SkyC0der I have figured out the solution. BTW, thx
CamperBot
@camperbot
Aug 11 2017 02:21
ccs99817 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2361 | @skyc0der |http://www.freecodecamp.com/skyc0der
iso
@iso1048
Aug 11 2017 02:22
@EgnaroDev true. what subjects do you take?
CallMeOrange
@EgnaroDev
Aug 11 2017 02:22
Right now, I'm taking History, math, english and P.E
Do you want specific? :trollface:
Gulsvi
@gulsvi
Aug 11 2017 02:22
@ccs99817 Sorry I couldn't help :/ I am not that good at explaining the more difficult javascript challenges
iso
@iso1048
Aug 11 2017 02:22
oh bro where are the sciences? @EgnaroDev
CallMeOrange
@EgnaroDev
Aug 11 2017 02:23
Probably next semester
iso
@iso1048
Aug 11 2017 02:23
true
CallMeOrange
@EgnaroDev
Aug 11 2017 02:23
Could be chemistry
Gulsvi
@gulsvi
Aug 11 2017 02:23
Time for dinner :yum: talk to you all soon :wave:
CallMeOrange
@EgnaroDev
Aug 11 2017 02:23
@SkyC0der :wave:
iso
@iso1048
Aug 11 2017 02:23
later
juni
@junipberry
Aug 11 2017 02:24
have a good dinner!
CallMeOrange
@EgnaroDev
Aug 11 2017 02:25
@gothamknight do you live in US?
iso
@iso1048
Aug 11 2017 02:27
nah
CallMeOrange
@EgnaroDev
Aug 11 2017 02:27
Ah
Well I have to go to do homeworks
:wave:
iso
@iso1048
Aug 11 2017 02:27
later
jimssonlim
@jimssonlim
Aug 11 2017 05:57
question is the help here only for the assignments or challenges or you can do external
i meant i can ask help for other front end tasks i am stuck with
Markus Kiili
@Masd925
Aug 11 2017 06:05
@jimssonlim You can ask.
hermeticlock
@hermeticlock
Aug 11 2017 06:38

How can I move my text in the first panel up? https://codepen.io/hermes/pen/eEROzo

Shouldn't it default at the top left corner? Why is it hugging the bottom of the screen?

iso
@iso1048
Aug 11 2017 06:54
@hermeticlock your padding-top in the .panel1. try changing that
hermeticlock
@hermeticlock
Aug 11 2017 07:41
That's there to bring the image down a bit
Without that the image looks very weird
but it does move the text down
@gothamknight
iso
@iso1048
Aug 11 2017 07:46
@hermeticlock you could give the .panel1 a height, then remove that padding-top
hermeticlock
@hermeticlock
Aug 11 2017 07:48
I'll see how that works, thanks
@gothamknight Thanks, that did it.
CamperBot
@camperbot
Aug 11 2017 07:50
hermeticlock sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 369 | @gothamknight |http://www.freecodecamp.com/gothamknight
hermeticlock
@hermeticlock
Aug 11 2017 07:53

So then here's my follow up question. Because when I do margin-left or whatever to move text, it's only for my current resolution, is there a way for me to resize the text, so that it's always by a certain spot on the background image?

My main concern is that I don't want the text interacting with the characters on the page. I want it displayed to the left or right of them.

Long Nguyen
@longnt80
Aug 11 2017 08:04
@hermeticlock do research on responsive design (media query)
iso
@iso1048
Aug 11 2017 08:14
@hermeticlock ^ (codecademy has a useful course on responsive design - that is where I learnt it from)
Alexander Domikov
@AlexanderDom
Aug 11 2017 08:36
@hermeticlock you can actually start from first article on responsive web design :) https://alistapart.com/article/responsive-web-design
thinsoldier
@thinsoldier
Aug 11 2017 08:39
Should the more specific parts of your css be earlier or later in your file?
iso
@iso1048
Aug 11 2017 08:41
@thinsoldier "In short: more specific rules override more general ones. Specificity is defined based on how many IDs, classes, and element names are involved, as well as whether the !important declaration was used. When multiple rules of the same "specificity level" exist, whichever one appears last wins." https://stackoverflow.com/questions/9459062/in-which-order-do-css-stylesheets-override
thinsoldier
@thinsoldier
Aug 11 2017 08:41
thanks @gothamknight
CamperBot
@camperbot
Aug 11 2017 08:41
thinsoldier sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 370 | @gothamknight |http://www.freecodecamp.com/gothamknight
Alexander Domikov
@AlexanderDom
Aug 11 2017 08:41
for a same rule for exemple a class .test { color: green } .test { color: red } it's last rule who gonna be applied on green one, and test element gonna have red text
batman was faster than me :)
iso
@iso1048
Aug 11 2017 08:43
@AlexanderDom i just copy/pasted haha
Alexander Domikov
@AlexanderDom
Aug 11 2017 08:44
:)
iso
@iso1048
Aug 11 2017 08:45
@AlexanderDom what stage are you at in fCC?
Alexander Domikov
@AlexanderDom
Aug 11 2017 08:46
there are this memory image for css specificity :) https://stuffandnonsense.co.uk/archives/images/specificitywars-05v2.jpg
pomodoro clock since year or more ^^
and you @gothamknight ?
iso
@iso1048
Aug 11 2017 08:48
@AlexanderDom haha that picture is good. Im still doing intermediate algorithms
@SkyC0der look at the above image
Alexander Domikov
@AlexanderDom
Aug 11 2017 08:58
iso
@iso1048
Aug 11 2017 09:01
@AlexanderDom i prefer star wars
Ben
@bhmann
Aug 11 2017 13:37

Anyone able to help debug some bootstrap CSS/fluid-container mischief? I have two sections that are using the same grid framework on a page... one behaves fine but the other refuses to stack properly.

codepen link

Ken Haduch
@khaduch
Aug 11 2017 13:48
@bhmann - I can have a look at it...
@bhmann - you are not using row divs to enclose your col divs... that could be one problem.
@bhmann your align=center attributes are probably not valid, even though things are centered... I guess that the "align" attribute is deprecated, so it might work but you cannot count on it to stay working.
Ken Haduch
@khaduch
Aug 11 2017 14:01
@bhmann - I would think that the biggest problem is not using <div class="row"> to be the parent of your column divs...
Gulsvi
@gulsvi
Aug 11 2017 14:45
@gothamknight lol
this is web responsive or not,guyzzz...
dinesh
@1532j0004kg
Aug 11 2017 15:04
what's wrong in this?
Roxroy
@roxroy
Aug 11 2017 15:11
@1532j0004kg , it looks good on iphone and android. The photo section would look better with some padding around the pics.
dinesh
@1532j0004kg
Aug 11 2017 15:13
Its web responsive bro?
dinesh
@1532j0004kg
Aug 11 2017 15:18
@roxroy
Roxroy
@roxroy
Aug 11 2017 15:21
@1532j0004kg , your page is responsive to the size of the browser window on the computer and it also looks good on mobile. So that is a win too.
dinesh
@1532j0004kg
Aug 11 2017 15:22
thanks a lot broieee....
Thayyeb salim
@Thayyebsalim
Aug 11 2017 15:27
thanks @SkyC0der
CamperBot
@camperbot
Aug 11 2017 15:27
thayyebsalim sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2364 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 11 2017 15:32
@roxroy Are you sure about that?
The image doesn't look right on my iphone
image.png
Daniel Feldman
@Feldbot
Aug 11 2017 15:42
Howdy campers. I wondered if someone can help me understand the "counting card" exercise. I'm close (I think) but hung up on some of the return results.
Ken Haduch
@khaduch
Aug 11 2017 15:43
@Feldbot - please post your code and we can help!
Daniel Feldman
@Feldbot
Aug 11 2017 15:44
@khaduch - Thanks, I'm new here... Do I just drop the code into the message here?
CamperBot
@camperbot
Aug 11 2017 15:44
feldbot sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3193 | @khaduch |http://www.freecodecamp.com/khaduch
Ken Haduch
@khaduch
Aug 11 2017 15:45
@Feldbot - post your code with a line with three backticks ``` at the top, with no other content, then the code, then another line with three backticks ``` at the bottom.
you can edit the note that you post if it doesn't quite come out right the first time...
https://forum.freecodecamp.com/t/markdown-code-formatting/18391 - for the markdown code posting details, @Feldbot
Daniel Feldman
@Feldbot
Aug 11 2017 15:46
var count = 0;

function cc(card) {
  // Only change code below this line
  switch (card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
      count++;
      break;
    case 7:
    case 8:
    case 9:
      count = count;
      break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      count--;
      break;
    default:
      return "Change Me";
  }
  if (card >=2 && card <=6) {
    return count + " Bet";
  } else if (card >=7 && card <=9) {
    return count + " Hold";
  } else if (card == 10 || card == 'J' || card == 'Q' || card == 'K' || card == 'A') {
    return count + " Hold";
  } else { 
  return "Change Me"; }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(2); cc(10);
Ken Haduch
@khaduch
Aug 11 2017 15:49
@Feldbot - good job posting. Now at the end of the function, you should be checking the value of count and not the value of the cards, because the switch statement is handling the card values.
Daniel Feldman
@Feldbot
Aug 11 2017 15:50
Thanks @khaduch. Okay, that makes sense, I wondered about that. I'll go back to try that out. Thanks for the hint and help with the posts!
CamperBot
@camperbot
Aug 11 2017 15:50
feldbot sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: feldbot already gave khaduch points
Ken Haduch
@khaduch
Aug 11 2017 15:52

@Feldbot - the instructions say:

The function will then return a string with the current count and the string "Bet" if the count is positive, or "Hold" if the count is zero or negative. The current count and the player's decision ("Bet" or "Hold") should be separated by a single space.

So you should be basing the final return on the value of count. And you should not have any of the "Change Me" code in there - that should be removed by your edits with new code.

and you're welcome - if you don't get it sorted out, please post again.
Daniel Feldman
@Feldbot
Aug 11 2017 15:55
@khaduch - I got it! Thanks very much for the help, that is awesome. Not quite sure what you mean by not having "Change Me" code in there though. Don't you need that as the catchall for invalid input?
CamperBot
@camperbot
Aug 11 2017 15:55
feldbot sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: feldbot already gave khaduch points
Angel J Piscola
@Redmega
Aug 11 2017 16:02
@Feldbot That's not what the instructions say ;)
Ken Haduch
@khaduch
Aug 11 2017 16:02

@Feldbot - you should have something to handle incorrect input, but you don't really want it to have a return of "Change Me"... the line should be replaced with something. In this context, it's not really useful to replace it with anything. In a real situation it would depend on the context - some way to notify the user that there was an error in the input... In my solution for this challenge, I didn't have cases for the "7, 8, 9", but I let the default handle them, and I did nothing there - count = count; is the same as doing nothing, if you get what I mean? My code for that looked like this:

    default:
      // do nothing for 7, 8, 9
  } // end of the switch statement

So it just fell through for those values. It made the code a little bit shorter.

Angel J Piscola
@Redmega
Aug 11 2017 16:02
Whoops wrong mention
Daniel Feldman
@Feldbot
Aug 11 2017 16:12
@khaduch - I think I understand. I put
` case 7: case 8: case 9: break; `
in to do nothing for those inputs, so it wasn't setting 7, 8 ,9 to zero. I then made the default say "Change Me" and took it out of the last else statement. That was redundant I guess. Lots of ways to do this I suppose. Thanks again for the help!
CamperBot
@camperbot
Aug 11 2017 16:12
feldbot sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: feldbot already gave khaduch points
Daniel Feldman
@Feldbot
Aug 11 2017 16:19
@khaduch How did you get your last post's code to be embedded in the middle of your post? I just tried that and it came out wonky.
Gaurav
@gauravmagan
Aug 11 2017 16:21
hi what the good practise working in a team with VCS to do do every day before starting the work
@Feldbot @khaduch
@SkyC0der
terms of updating the master branch
Daniel Feldman
@Feldbot
Aug 11 2017 16:26
@gauravmagan I'm not sure as I am trying to learn git/github. That's a great question though, I'd be interested in hearing more on VCS best practices.
Ken Haduch
@khaduch
Aug 11 2017 16:36
@Feldbot - you can put embedded code in a line with a single backquote on each side of the line, so you would post `var myVar = "this string";` and it should show up as var myVar = "this string"; and you can continue with other text. For the blocks of code, you do as before - three backquotes on separate lines before and after the code block.
Daniel Feldman
@Feldbot
Aug 11 2017 16:37
Thanks Ken!
Ken Haduch
@khaduch
Aug 11 2017 16:37
@Feldbot - it should all be described in https://forum.freecodecamp.com/t/markdown-code-formatting/18391 that forum post on Markdown code posting.
you're welcome...
glitz20
@glitz20
Aug 11 2017 16:42
hey guys I am not being able to control the height of my carousel. Also how can I change the sliding style? https://codepen.io/sabin20/pen/EvPgMd
dinesh
@1532j0004kg
Aug 11 2017 17:02
``color: blue;```
``color: blue;```
Johnny
@jtan3
Aug 11 2017 17:12
@sabin20 if i change the max-height to 100px it changes.
Zachary Orona-Calvert
@TheTRUEHoohah
Aug 11 2017 17:43
hey guys how would i get the for loop put 21 moves from the array into a new array

$(document).ready(function() {
$("#tako").click(function() {
var combos = [
"R2",
"R",
"'R",
"L",
"L'",
"L2",
"M",
"'M",
"M2",
"'D",
"D2",
"D",
"'U",
"U2",
"U"
];

for(var randomstring = 0; randomstring < 21; randomstring++)
{var com = combos[Math.floor(combos.length * Math.random())];}  
console.log(com);

document.getElementById("outputs").value = com;

});
});

Gulsvi
@gulsvi
Aug 11 2017 17:51
@TheTRUEHoohah define an empty array and push each random combo into it
var com = [];

for(var randomstring = 0; randomstring < 21; randomstring++) {
  com.push(combos[Math.floor(combos.length * Math.random())]);
}
Zachary Orona-Calvert
@TheTRUEHoohah
Aug 11 2017 17:53
thanks @SkyC0der how would i make sure that two of the same moves dont get placed tnext to each other in the array
CamperBot
@camperbot
Aug 11 2017 17:53
thetruehoohah sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2367 | @skyc0der |http://www.freecodecamp.com/skyc0der
Nitin Chandran Nair
@NitinNair89
Aug 11 2017 18:08
Hello Friends, I need some advice..
Nitin Chandran Nair
@NitinNair89
Aug 11 2017 18:15
anyone online? :)
Roxroy
@roxroy
Aug 11 2017 18:16
@NitinNair89 , sure what's your question. I will see if I can help.
Nitin Chandran Nair
@NitinNair89
Aug 11 2017 18:18
I work full time as a software engineer in a Mainframe based project.. But I am more interested in the UI side of websites. How can I make this career switch from Mainframe to UI? I am good at HTML, CSS, Bootstrap, materializecss, etc. I need advice on what stuffs I would need to learn (links if any) to upgrade myself and get ready for a job as a UI Developer.
Barbara Pentoney
@flyfishingbarbara
Aug 11 2017 18:21
@SkyC0der thanks for the info on bootstap3 carousel...I didn't see it, I looked in the components tab.... thanks!
CamperBot
@camperbot
Aug 11 2017 18:21
flyfishingbarbara sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2369 | @skyc0der |http://www.freecodecamp.com/skyc0der
Roxroy
@roxroy
Aug 11 2017 19:11
@NitinNair89 , start working your way through the FCC curriculum. I would suggest that you complete all the front end certification exercise and projects. Also try working on some other frontend weekend project to get some more practice on the UI aspect. Afterwards, you can work on integrating with the backend.
Nitin Chandran Nair
@NitinNair89
Aug 11 2017 19:12
I am at the Algorithm challenges on FCC right now
Thank you @roxroy :)
CamperBot
@camperbot
Aug 11 2017 19:13
nitinnair89 sends brownie points to @roxroy :sparkles: :thumbsup: :sparkles:
:star2: 1103 | @roxroy |http://www.freecodecamp.com/roxroy
fdemaa
@fdemaa
Aug 11 2017 19:33
anyone know how can i center a canvas icon, skyicons ?
Christopher McCormack
@cmccormack
Aug 11 2017 19:48
@fdemaa you should be able to just do margin: auto on the element
@fdemaa https://codepen.io/cmccormack/pen/gRPYeO I have an example using a fixed position element
although it does look like left: 0 and right: 0 are also required
fdemaa
@fdemaa
Aug 11 2017 19:49
@cmccormack thanks chris!
CamperBot
@camperbot
Aug 11 2017 19:49
fdemaa sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1121 | @cmccormack |http://www.freecodecamp.com/cmccormack
Christopher McCormack
@cmccormack
Aug 11 2017 19:51
np
glitz20
@glitz20
Aug 11 2017 20:32
hey guys how can I set the height of this image to 590 px and width of 100%, without disrupting its aspect ratio. https://codepen.io/sabin20/pen/EvPgMd?editors=1100
Angel J Piscola
@Redmega
Aug 11 2017 20:38
@sabin20 Add object-fit: cover; to .overimage
But in this case I think it might be better for you to make it a background-image of the div, instead of putting the <img> tag in there
Daniel Feldman
@Feldbot
Aug 11 2017 20:43
Hi, I'm working on "Testing objects for properties" and I am able to test for the property, but don't know how to return the property's associated value. Any thoughts?

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here
  if (myObj.hasOwnProperty(checkProp)) {
    return checkProp;
  } else {
    return "Not Found";
  }
} 
// Test your code by modifying these values
checkObj("gift");
korzo
@korzo
Aug 11 2017 20:44
@Feldbot myObj[checkProp]
glitz20
@glitz20
Aug 11 2017 20:44
@Redmega thanks
CamperBot
@camperbot
Aug 11 2017 20:44
sabin20 sends brownie points to @redmega :sparkles: :thumbsup: :sparkles:
:cookie: 156 | @redmega |http://www.freecodecamp.com/redmega
Daniel Feldman
@Feldbot
Aug 11 2017 20:47
@korzo Thanks, that works. Hard to see why it delivers the value, still struggling with that.
CamperBot
@camperbot
Aug 11 2017 20:47
feldbot sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 366 | @korzo |http://www.freecodecamp.com/korzo
korzo
@korzo
Aug 11 2017 20:48
@Feldbot You can access object properties the same way you access array elements
@Feldbot It's useful when you want to access property stored in variable. You can't do this with dot notation
Barbara Pentoney
@flyfishingbarbara
Aug 11 2017 20:52
@SkyC0der hi sky....how can I 'save' someone's codepen so I can access it....someone at FCC San Diego on the facebook page shared a codepen they made as a 'input cheatsheet'...can I save this in my codepen account to be able to access it ...??
Daniel Feldman
@Feldbot
Aug 11 2017 20:53
@korzo Thanks for the tips. So say if myObj also stored an array item (maybe gift has pony and book, how would that get accessed?
CamperBot
@camperbot
Aug 11 2017 20:53
feldbot sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:warning: feldbot already gave korzo points
korzo
@korzo
Aug 11 2017 20:55
@Feldbot myObj[arrayName][2]
@Feldbot or myObj.arrayName[2]
Daniel Feldman
@Feldbot
Aug 11 2017 20:57
@korzo arrayName would be the property name, like myObj[gift][2]?
@korzo or myObj.gift[2]?
korzo
@korzo
Aug 11 2017 20:59
@Feldbot if gift is variable, use bracket notation. If it's name of property, use dot notation or bracket notation as you want
Daniel Feldman
@Feldbot
Aug 11 2017 21:00
@korzo gift is the myObj property in the code above
@korzo I was just trying to understand if there were an array value in myObj how that would be accessed in theory.
korzo
@korzo
Aug 11 2017 21:02
@Feldbot
var myObj = {
  gift: [1,2,3]
};

var prop = 'gift';

myObj.gift[0];
myObj[prop][0];
Barbara Pentoney
@flyfishingbarbara
Aug 11 2017 21:04
looks like skyc0der is not avail...plz help....how can I 'save' someone's codepen so I can access it....someone at FCC San Diego on the facebook page shared a codepen they made as a 'input cheatsheet'...can I save this in my codepen account to be able to access it ...??
Daniel Feldman
@Feldbot
Aug 11 2017 21:06
@korzo Thanks for the example! That makes sense. So in the case of myObj[checkProp] it just returns whatever value is there by default if there is just one value?
CamperBot
@camperbot
Aug 11 2017 21:06
feldbot sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:warning: feldbot already gave korzo points
juni
@junipberry
Aug 11 2017 21:06
function getProperty(obj, key) {
  (obj[key]= 'value');
  return obj[key].value;
}
iso
@iso1048
Aug 11 2017 21:06
@flyfishingbarbara you can click 'Fork' i think
Barbara Pentoney
@flyfishingbarbara
Aug 11 2017 21:06
woop woop..nvm I figured it out! thanks all and @SkyC0der
CamperBot
@camperbot
Aug 11 2017 21:06
flyfishingbarbara sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2370 | @skyc0der |http://www.freecodecamp.com/skyc0der
juni
@junipberry
Aug 11 2017 21:07
what am I leaving out if I want the value to return at the given key?
Barbara Pentoney
@flyfishingbarbara
Aug 11 2017 21:08
@gothamknight thanks...I figured it out...there was a 'add to collection' button when I hovered....clicked it to see what that did and it saved it into my account under 'collections' thank again
CamperBot
@camperbot
Aug 11 2017 21:08
flyfishingbarbara sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 371 | @gothamknight |http://www.freecodecamp.com/gothamknight
korzo
@korzo
Aug 11 2017 21:12
@Feldbot Yes. the value of property name stored in checkProp
Daniel Feldman
@Feldbot
Aug 11 2017 21:13
@korzo Well thank you very much for the help. I really appreciate it. If I could give you another brownie point I would!
CamperBot
@camperbot
Aug 11 2017 21:13
feldbot sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:warning: feldbot already gave korzo points
korzo
@korzo
Aug 11 2017 21:15
@Feldbot Glad to help
glitz20
@glitz20
Aug 11 2017 21:39
hey guys is this the correct way to put two classes in a media query?
@media screen and (max-width:767px){
    .forum{
        margin:10px 100px;
    },
    .contact>.par{
    margin:20px 40px;
    }
}
iso
@iso1048
Aug 11 2017 21:43
@sabin20 you dont need a comma to separate the css rules
Ghost
@ghost~56c733f2e610378809c24d2c
Aug 11 2017 21:51
yes just remove the comma
Liam Docherty
@ldocherty1
Aug 11 2017 21:59
Yo
iso
@iso1048
Aug 11 2017 22:00
@ldocherty1 how is it going?
Liam Docherty
@ldocherty1
Aug 11 2017 22:01
@gothamknight Good thank you, how is everything on your end? I've just been taking my time working on my portfolio trying to understand and take in things at a slow approach.
CamperBot
@camperbot
Aug 11 2017 22:01
ldocherty1 sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 372 | @gothamknight |http://www.freecodecamp.com/gothamknight
iso
@iso1048
Aug 11 2017 22:02
@ldocherty1 that is good. yeah its ok. whatever works for you bro. how is the portfolio going?
iso
@iso1048
Aug 11 2017 22:32
@ldocherty1 ok dude the strangest thing seemed to work for me:
remove display: none; from the .navbar css rule. then add $('.navbar').css('display', 'none'); directly under you document ready function.
have no idea why it worked, maybe @SkyC0der can enlighten us
Gulsvi
@gulsvi
Aug 11 2017 22:34
@flyfishingbarbara Sorry, wasn't available. Glad you got it all figured out - hope you're getting some time to go fishing between all this coding :fish: :fishing_pole_and_fish: :)
@gothamknight What isn't working?
iso
@iso1048
Aug 11 2017 22:35
@SkyC0der i was helping @ldocherty1 with his second problem (above).
Liam Docherty
@ldocherty1
Aug 11 2017 22:38
Sorry let me re write it to make it more clear had lots of spelling mistakes.

Problem 1 - I have put an animate.css effect on my section two title text and hr element (line). However, the effect on these elements activates when the page loads. When the user goes to my section 2 I want the effect then to take place. Not to sure how to make that happen.

Problem 2 - Due to me wanting to have my navigation bar at the top of every section apart from section one which is known as #part1 I used the following CSS which is having a major effect on my navigation bar. Nothing is straight and lined up on my navigation bar. In terms of my CSS the display part is having an effect on the elements within the navbar. However, if I remove display: none; and everything is lined up, my navigation bar will be visible in section one which is not what I want.

.navbar {
    display: none;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10;
    height: 4rem;
    background-color: #003554;
}

https://jsfiddle.net/qg7jbxs2/7/

Gulsvi
@gulsvi
Aug 11 2017 22:38
Everything seems straight and lined up, I think I'm misunderstanding
Liam Docherty
@ldocherty1
Aug 11 2017 22:38
@gothamknight I'll check It out now thanks :)
CamperBot
@camperbot
Aug 11 2017 22:38
ldocherty1 sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:warning: ldocherty1 already gave gothamknight points
Liam Docherty
@ldocherty1
Aug 11 2017 22:38
@SkyC0der The navigation bar text and search button is out of place?
Gulsvi
@gulsvi
Aug 11 2017 22:39
Ahhh, I see. JSFiddle window was too small, so I only saw a mobile navbar button
Liam Docherty
@ldocherty1
Aug 11 2017 22:39
one sec I'll upload on codepen
thx for looking
Liam Docherty
@ldocherty1
Aug 11 2017 22:46

https://codepen.io/liamdocherty1/pen/dzzOGy

I have put an animate.css effect on my section two title text and hr element (line). However, the effect on these elements activates when the page loads. When the user goes to my section 2 I want the effect then to take place. Not to sure how to make that happen.

@gothamknight Thanks for fixing the navigation bar issue :)
CamperBot
@camperbot
Aug 11 2017 22:47
ldocherty1 sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:warning: ldocherty1 already gave gothamknight points
iso
@iso1048
Aug 11 2017 22:48
no problem
@ldocherty1 i don't know anything about css animations though, so good luck.
Liam Docherty
@ldocherty1
Aug 11 2017 22:49
thanks :) and no problem
Gulsvi
@gulsvi
Aug 11 2017 22:55
@ldocherty1 For the CSS animations, you could do something like this: https://codepen.io/skycoder/pen/WEEoRd?editors=1010
Every time the element is scrolled into view, it reapplies the bounce class
Liam Docherty
@ldocherty1
Aug 11 2017 22:56
@SkyC0der Perfect, thanks for taking your time to create this and answer my question.
CamperBot
@camperbot
Aug 11 2017 22:56
ldocherty1 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2371 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 11 2017 22:58
@gothamknight No idea why that worked, to be honest. Nice work figuring it out :)
iso
@iso1048
Aug 11 2017 22:58
@SkyC0der no skill; all fluke.
Liam Docherty
@ldocherty1
Aug 11 2017 22:59
lol you got skills
Gulsvi
@gulsvi
Aug 11 2017 22:59
Sometimes that takes skill tho ;)
Bootstrap just announced their beta - time to dive in and see what changed! https://blog.getbootstrap.com/2017/08/10/bootstrap-4-beta/
iso
@iso1048
Aug 11 2017 23:03
@SkyC0der when are you leaving for Spain?
Gulsvi
@gulsvi
Aug 11 2017 23:05
@gothamknight just over 2 weeks
iso
@iso1048
Aug 11 2017 23:10
@SkyC0der I forgot - are you going to work or to uni (or both)?
Gulsvi
@gulsvi
Aug 11 2017 23:11
Only studying there - but I might try to teach some english for cash on the side. Don't think I can legally do that though :)
Need a work visa
I teach english for beer
iso
@iso1048
Aug 11 2017 23:14
haha
Razvan
@razvanlikespizza
Aug 11 2017 23:30
@SkyC0der
Gulsvi
@gulsvi
Aug 11 2017 23:33
@razvanlikespizza Hello
What kind of pizza today? :)
Razvan
@razvanlikespizza
Aug 11 2017 23:34
Hmmm,I dont care about pizza,but we need beer 100%
Gulsvi
@gulsvi
Aug 11 2017 23:34
lol
webber1ea
@webber1ea
Aug 11 2017 23:34
I am attempting to make a popup/modal when a customer clicks the delete button asking if they are sure they want to delete but the button already has an ng-click on it. I am having a difficult figuring this out. Anyone able to help?
glitz20
@glitz20
Aug 11 2017 23:35
hey guys can anyone let me know why my media query is not working? https://codepen.io/sabin20/pen/EvPgMd
Razvan
@razvanlikespizza
Aug 11 2017 23:36
.contact>.par? :3 I dont think that is the problem, that looks okay for me.
Liam Docherty
@ldocherty1
Aug 11 2017 23:41
@gothamknight What was the difference from my css and your JS?
@SkyC0der Have a good time in Spain, what you studying?
iso
@iso1048
Aug 11 2017 23:45
@ldocherty1 no idea bro. can you link your js fiddle again please? I want to try something out
Gulsvi
@gulsvi
Aug 11 2017 23:46
@ldocherty1 Linguistics mainly. Spanish grammar and literature is also a big part of it.
Liam Docherty
@ldocherty1
Aug 11 2017 23:47
sounds interesting
Liam Docherty
@ldocherty1
Aug 11 2017 23:54
@gothamknight What you trying?
Haven't update my fiddle but same principle applies. When I click the "search" button on my navbar why does it reload the page and the nav disappear ?
iso
@iso1048
Aug 11 2017 23:59
@ldocherty1 was just trying to add display: none; using a different selection, but nothing changed.