These are chat archives for FreeCodeCamp/Help

12th
Aug 2017
Ahmed Tarek
@ahmedtarek2134
Aug 12 2017 00:01
@sabin20 your media queries are working
I tested it
maybe your changes have no effects
dyon3334
@dyon3334
Aug 12 2017 00:21
how to loop over multidimensional arrays javascript ?any help ?
Margaret
@Margaret2
Aug 12 2017 00:24
@dyon3334 two for loops, one inside the other
for (var i = 0; .........) {
    for (var j = 0; ......) {
        console.log(arr[i][j]); 
    }
}
Ahmed Tarek
@ahmedtarek2134
Aug 12 2017 00:26
@Margaret2 ayyyyyy
Margaret
@Margaret2
Aug 12 2017 00:27
:wave:
Ahmed Tarek
@ahmedtarek2134
Aug 12 2017 00:27
how are you?!
Margaret
@Margaret2
Aug 12 2017 00:27
blah
gotta work in a few minutes
Ahmed Tarek
@ahmedtarek2134
Aug 12 2017 00:28
I gotta sleep in a few minutes :smile:
3:28 AM here
Margaret
@Margaret2
Aug 12 2017 00:28
:o
glitz20
@glitz20
Aug 12 2017 00:28
@ahmedtarek2134 can you see any reason why the media is not working for image 2
Razvan
@razvanlikespizza
Aug 12 2017 00:37
Hey.
glitz20
@glitz20
Aug 12 2017 00:48
hey guys why my media query is not working properly on second image? https://codepen.io/sabin20/pen/EvPgMd
Eric Miller
@ericmiller777
Aug 12 2017 01:12
I have a weird problem
click my search button
how can i make it so that text wraps in its button instead of going off screen
Gulsvi
@gulsvi
Aug 12 2017 01:17
@ericmiller777 Add spaces to the text so it can wrap or use word-wrap: break-word in your CSS
Eric Miller
@ericmiller777
Aug 12 2017 01:19
white-space: normal;
testing that
Gulsvi
@gulsvi
Aug 12 2017 01:19
white-space: normal is the default
Eric Miller
@ericmiller777
Aug 12 2017 01:19
it works :)
it wouldnt work without it maybe because im appending?
@SkyC0der thanks
CamperBot
@camperbot
Aug 12 2017 01:20
ericmiller777 sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2372 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
Aug 12 2017 01:21
@ericmiller777 It's because there are no spaces in your string, so it's treated as one really long word
Eric Miller
@ericmiller777
Aug 12 2017 01:21
lets test it
Gulsvi
@gulsvi
Aug 12 2017 01:22
You can also read how it works here: https://www.w3schools.com/cssref/css3_pr_word-wrap.asp
The word-wrap property allows long words to be able to be broken and wrap onto the next line.
Default value: normal
normal Break words only at allowed break points
go test it
on my screen now it is going past the button
im probably doing somthing stupid causeing it to happen
now adding fix
allowed breakpoints are spaces and hyphens
10119
@10119
Aug 12 2017 01:26

Hi all!
I'm trying to create a small Dashboard for overwatch my mining statistics. This is where I'm at, at the moment.: https://github.com/10119/Dashboard/blob/master/index.html

I'm facing multiple Problems. I would like to update the information by 30 seconds timer for example. Maybe some of u guys have a tip how to realize my project at best, cause i think there will be a better solution to fetch and display the api information i want. Thanks in advance!

Long Nguyen
@longnt80
Aug 12 2017 01:29
@ericmiller777 @SkyC0der I tried this on the li:
word-break: break-word;
white-space: normal;
Eric Miller
@ericmiller777
Aug 12 2017 01:30
hmm?
Long Nguyen
@longnt80
Aug 12 2017 01:33
@SkyC0der @ericmiller777 what's the difference between word-wrap and word-break?
Ian Hicks
@ijhicks
Aug 12 2017 01:49
quick question about writing a javascript if statement
will this work? if (65 <= str_code[j] <= 77)
or do I need && in there
Mukul Agrawal
@mukul09
Aug 12 2017 01:59
@ijhicks no this will not work you have to use && operator
Ian Hicks
@ijhicks
Aug 12 2017 02:00
ah ok cool
thanks @mukul09
CamperBot
@camperbot
Aug 12 2017 02:00
ijhicks sends brownie points to @mukul09 :sparkles: :thumbsup: :sparkles:
:cookie: 495 | @mukul09 |http://www.freecodecamp.com/mukul09
Mukul Agrawal
@mukul09
Aug 12 2017 02:00
@ijhicks :+1:
Ian Hicks
@ijhicks
Aug 12 2017 02:02
so this one is correct?
if (65 <= str_code[j] && str_code[j] <= 77)
Bill
@kirah1314
Aug 12 2017 02:03
@ijhicks that looks good if (65 <= str_code[j] && str_code[j] <= 77)
Gulsvi
@gulsvi
Aug 12 2017 02:05
@longnt80 From what I can tell in the CSS spec, word-break will work with East Asian languages. word-wrap will not. https://www.w3.org/TR/css-text-3/#word-break-property
Ian Hicks
@ijhicks
Aug 12 2017 02:07
ok great thanks @kirah1314 !
CamperBot
@camperbot
Aug 12 2017 02:07
ijhicks sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
Bill
@kirah1314
Aug 12 2017 02:07
@ijhicks by the way, if this is JavaScript, the best practice naming convention is camel case like strCode
CamperBot
@camperbot
Aug 12 2017 02:07
:cookie: 995 | @kirah1314 |http://www.freecodecamp.com/kirah1314
just1witness
@just1witness
Aug 12 2017 02:07
I know this isn't the answer to the challenge, but I'm just playing around with the code and seeing the different things is does. I can't for the life of me figure out why it returns "source.indexOf is not a function" can anyone see what I'm missing here?
function whatIsInAName(collection, source) {

  var arr = [];

  for (var j = 0; j < collection.length; j++){
   if (source.indexOf(collection[j]) === -1){
    arr.push(collection[j]);
     }
      }
  for (var i = 0; i < source.length; i++){
   if  (collection.indexOf(source[i]) === -1){
    arr.push(source[i]);     
     }
      } 
       return arr;  
        }

whatIsInAName([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
Ian Hicks
@ijhicks
Aug 12 2017 02:08
yeah it is.. JS.. that "_" stuff is force of habit from working with arcGIS for work lol
Bill
@kirah1314
Aug 12 2017 02:10
@just1witness indexOf is an array or string method. Is source an array or string?
just1witness
@just1witness
Aug 12 2017 02:11
! Ohhhhhhh, so if I convert the value to a string it would work?
I think it's an object
Bill
@kirah1314
Aug 12 2017 02:12
yup, if it's a string then it'll work :)
just1witness
@just1witness
Aug 12 2017 02:12
I'm still learning and confused, haha (after many many hours of study)
@kirah1314 Thank you!
CamperBot
@camperbot
Aug 12 2017 02:12
just1witness sends brownie points to @kirah1314 :sparkles: :thumbsup: :sparkles:
:cookie: 996 | @kirah1314 |http://www.freecodecamp.com/kirah1314
just1witness
@just1witness
Aug 12 2017 02:14
Nice, I put it in an array and it ran. Thank you!
Bill
@kirah1314
Aug 12 2017 02:15
you're welcome!
Mike Batista
@mbmontana
Aug 12 2017 02:27

Not looking for the answer, just a hint.

Instructions: Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found"

Am I in the ballpark here?

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

function checkObj(checkProp) {
  if myObj.hasOwnProperty(checkProp) {return "checkProp";}
else {return "Not Found";}
  // Your Code Here

  return "Change Me!";
}

// Test your code by modifying these values
checkObj("gift");
Margaret
@Margaret2
Aug 12 2017 02:32
@mbmontana you're on the right track. just have to change your return value to get the value of the property
Bill
@kirah1314
Aug 12 2017 02:32
@mbmontana not quite but on the right track, you're returning strings while the challenge asks for the value
Joseph
@revisualize
Aug 12 2017 02:48
@mbmontana return "checkProp"; is just returning a string
@mbmontana This if myObj.hasOwnProperty(checkProp) should be in the if (condition)
@mbmontana How do you access an object property with a variable?
stashe86
@stashe86
Aug 12 2017 03:16
I'm trying to switch to using atom instead of coding on codepen, and I can't figure out how to get bootstrap to work, or link my javascript file. I've added scripts for them, but they don't seem to be working.
Bill
@kirah1314
Aug 12 2017 03:29
@stashe86 got an html file you can show?
stashe86
@stashe86
Aug 12 2017 03:30
I figured out the javascript issue. It turns out, I had the jquery scripts in the wrong place. Now I just have to figure out how to get bootstrap to work.
aaaand i think i just realized that bootstrap is a stylesheet... so i think i might have it
Bill
@kirah1314
Aug 12 2017 03:31
@stashe86 yeah, bootstrap needs jquery loaded first. Did you copy the bootstrap links to the head element?
stashe86
@stashe86
Aug 12 2017 03:32
ooooh
i had bootstrap above jquery
stashe86
@stashe86
Aug 12 2017 03:34
got it. i had bootstrap as a script and not a link
Bill
@kirah1314
Aug 12 2017 03:34
:thumbsup:
stashe86
@stashe86
Aug 12 2017 03:34
Thanks!
I kinda wish that FCC had a little tutorial on working with a text editor before they put you on codepen
Yuserah Din
@YuserahN
Aug 12 2017 04:32
function fearNotLetter(str) { 

  var num;  


  for(var i = 0; i < str.length; i++) {  
    num = str.charCodeAt(i); 

    if(num - (str.charCodeAt(i + 1)) !== -1) {
      return String.fromCharCode(num + 1); 
    }   
  }

  return undefined; 
}

fearNotLetter("abcdefghjklmno");
Why is my code not working?
I'm supposed to find the missing letter from the given str. If there is no missing letter, I'm supposed to return undefined. The first part is working, the latter is not.
Yuserah Din
@YuserahN
Aug 12 2017 04:39
Meaning that it's able to find and return the missing letter, but in the case where there is no missing letter, it's not returning undefined.
BryanS
@BSISJ7
Aug 12 2017 04:52
@YuserahN I think it's due to you getting NaN from str.charCodeAt(i + 1) when i equals str.length-1 since you're checking a non-existant index at str.length.
Eric Miller
@ericmiller777
Aug 12 2017 06:32
hey guys
Eric Miller
@ericmiller777
Aug 12 2017 06:44
$("#searchButton").on("click", function () {
var wikiSearchBoxValue = document.getElementById("searchBox").value;
$("#searchResults").remove();
$.ajax({
    url: "https://en.wikipedia.org/w/api.php?action=opensearch&search=" + wikiSearchBoxValue + "&limit=10&namespace=0&format=json",
    type: "GET",
    dataType: "jsonp"
    }).done( function ( data ) {
    //$(".testWiki").html(" ");
    //$(".testWiki").html(data[1][0] + " " + data[2][0]);
    for(var i = 0; i < data[1].length; i++){
    $(`<li class="list-group-item btn btn-default" style="color: blue; text-align: center; white-space: normal;">test</li>`).insertAfter("#searchResults");
    };
});
});
I need the remove to run
then the list items to be made
but for some reason no matter where i place the remove
it erases the list items
Sandip Shrestha
@saninmersion
Aug 12 2017 06:46
@ericmiller777 $("#searchResults").remove(); removes the html element with id searchResults from the dom.
Eric Miller
@ericmiller777
Aug 12 2017 06:47
i see
Sandip Shrestha
@saninmersion
Aug 12 2017 06:47
@ericmiller777 insertAfter("#searchResults"); there probably is no searchResult element
Eric Miller
@ericmiller777
Aug 12 2017 06:47
hmm
can i do .children.remove?
Sandip Shrestha
@saninmersion
Aug 12 2017 06:49
why doyou want to remove the searchResult?
Eric Miller
@ericmiller777
Aug 12 2017 06:49
because currently
each time someone searchs
more and more is appended per search
where i want it to erase the previous results
Sandip Shrestha
@saninmersion
Aug 12 2017 06:51
okay the simpler fix would be to store the data you are inserting from for(var i = 0; i < data[1].length; i++) in a var html and then use innerHtml(). I think
innerhtml() will just replace the old data as a whole.
no need to use remove or insert after
Eric Miller
@ericmiller777
Aug 12 2017 06:54
@saninmersion um
.>;
ill read about it
Sandip Shrestha
@saninmersion
Aug 12 2017 06:57
var html = "";
for(var i = 0; i < data[1].length; i++){
    html  += '<li class="list-group-item btn btn-default" style="color: blue; text-align: center; white-space: normal;">test</li>`;
    };
$("#content").html(html);
@ericmiller777 sth like this
Eric Miller
@ericmiller777
Aug 12 2017 07:01
@saninmersion thanks
CamperBot
@camperbot
Aug 12 2017 07:01
ericmiller777 sends brownie points to @saninmersion :sparkles: :thumbsup: :sparkles:
:cookie: 535 | @saninmersion |http://www.freecodecamp.com/saninmersion
Sandip Shrestha
@saninmersion
Aug 12 2017 07:01
@ericmiller777 :thumbsup:
Eric Miller
@ericmiller777
Aug 12 2017 07:58
@saninmersion how can i insert it as html after the <ul> tho?
unless i giev the div a id then do like "<ul>" +
but even then it would insetrt it into the div....
Eric Miller
@ericmiller777
Aug 12 2017 08:30
@saninmersion thanks it does work
CamperBot
@camperbot
Aug 12 2017 08:30
ericmiller777 sends brownie points to @saninmersion :sparkles: :thumbsup: :sparkles:
:cookie: 536 | @saninmersion |http://www.freecodecamp.com/saninmersion
Johannes Weber
@JohaWeber
Aug 12 2017 08:48
$c-brand: #00ff00;
$color-brand: $c-brand;
Does anybody has an idea how to get the longhand for the variables in css/sass generated (perhaps with mixins or some other sort of function)?
is it even possible to have variable-names generated?
Why do you want to do that?
Johannes Weber
@JohaWeber
Aug 12 2017 08:56
some people prefer longhands because they think "c-" is not clear enough. some prefer shorthands. I want to give both a solution
besides that, I ran into this "want to generate variable names" multiple times
teevik
@teevik
Aug 12 2017 11:48
Don't think you can generate variables
Johannes Weber
@JohaWeber
Aug 12 2017 11:56
@teevik :(
teevik
@teevik
Aug 12 2017 11:58
Looks like you can generate variables if you use ruby version https://stackoverflow.com/a/19894987
Not sure
Sounds like a major pain in the ass if it's possible
Ai rui 艾瑞
@aisolae
Aug 12 2017 12:06
what's changed with bootstrap 4
one can't set background
image
Rajan
@ProgramNovice
Aug 12 2017 13:29
Hello guys
I have a doubt in the challenge Add Images to your Website
they have mentioned "Note that in most cases, img elements are self-closing"
what does self closing mean?
Rimi.
@Codevotee
Aug 12 2017 13:35
can someone tell me why child elements are inheriting the parent element's CSS animation?
teevik
@teevik
Aug 12 2017 13:35
It automatically does <img/> even though you do <img> @ProgramNovice
cowCrazy
@cowCrazy
Aug 12 2017 13:36
@ProgramNovice usually you have an html tag like this <h1>foo</h1>, so self closing is <img />
Rimi.
@Codevotee
Aug 12 2017 13:36

@ProgramNovice self-closing means it doesn't require a closing tag e.g.
Self-closing element:

<img src="" alt="" />

Non-self-closing element:

<a href="" target="">...</a>
Rajan
@ProgramNovice
Aug 12 2017 13:37
@teevik ok thanks :)
CamperBot
@camperbot
Aug 12 2017 13:37
programnovice sends brownie points to @teevik :sparkles: :thumbsup: :sparkles:
:cookie: 228 | @teevik |http://www.freecodecamp.com/teevik
Rajan
@ProgramNovice
Aug 12 2017 13:37
@cowCrazy ok thanks :)
@APRim05 ok thanks :)
CamperBot
@camperbot
Aug 12 2017 13:37
programnovice sends brownie points to @aprim05 :sparkles: :thumbsup: :sparkles:
:cookie: 622 | @aprim05 |http://www.freecodecamp.com/aprim05
Rajan
@ProgramNovice
Aug 12 2017 13:38
One more doubt in that challenge is that
"All img elements must have an alt attribute. The text inside an alt attribute is used for screen readers to improve accessibility and is displayed if the image fails to load."
what does "improve accessibility: mean in this statement?
"improve accessibility"
Rimi.
@Codevotee
Aug 12 2017 13:39
users with disabilities may use text-to-speech conversion tools which read the alt attribute of an image to the user, for example when they cannot see the image @ProgramNovice
the alt attribute should describe what is being shown in the image
Rajan
@ProgramNovice
Aug 12 2017 13:43
oh i c
@APRim05 ok thanks. now i understand better :)
CamperBot
@camperbot
Aug 12 2017 13:43
programnovice sends brownie points to @aprim05 :sparkles: :thumbsup: :sparkles:
:warning: programnovice already gave aprim05 points
Praveen Saraogi
@saraogipraveen
Aug 12 2017 14:19
how software engineer is different from software developer
which is best to choose as a career option
madhuri soni
@sonimadhuri
Aug 12 2017 14:36
Hey guys finished my wikipedia viewer !!https://codepen.io/madhurisoni12/full/QgevPv/
Stephen James
@sjames1958gm
Aug 12 2017 15:11
@sonimadhuri When I type in a phrase and hit enter it all goes away
Ramsey Njire
@RamseyNjire
Aug 12 2017 15:19
@raviloop Think of it this way... Every software engineer is a software developer, but not every software developer is a software engineer.
Ramsey Njire
@RamseyNjire
Aug 12 2017 15:27
@raviloop A software engineer applies engineering problems to software development, finding specific solutions to client problems. Software developers, on the other hand, are the creative force behind the actual design of the software.
madhuri soni
@sonimadhuri
Aug 12 2017 15:37
@sjames1958gm thanks for pointing it! any suggestion on how i can handle that?
CamperBot
@camperbot
Aug 12 2017 15:37
sonimadhuri sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8303 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Aug 12 2017 15:37
If you are using a form - then - use preventdefault functoin
madhuri soni
@sonimadhuri
Aug 12 2017 15:40
@sjames1958gm oh okay will try!
Darren
@DarrenfJ
Aug 12 2017 15:55
morning fCC
Kyle Holm
@thekholm80
Aug 12 2017 15:57
@DarrenfJ :wave:
Darren
@DarrenfJ
Aug 12 2017 15:57
@thekholm80 hey buddy :D
Kyle Holm
@thekholm80
Aug 12 2017 15:57
@DarrenfJ oops, i mean "hey assface"
how did it go?
Darren
@DarrenfJ
Aug 12 2017 15:58
@thekholm80 really good actually.. i think one of our friends livestreamed it on facebook as weel
:D
Kyle Holm
@thekholm80
Aug 12 2017 15:58
oh very cool
Darren
@DarrenfJ
Aug 12 2017 15:59
yah it was fun
brb :coffee:
Raceme
@emrulkayesraceme
Aug 12 2017 16:11
Hi everyone
Mike Batista
@mbmontana
Aug 12 2017 16:14

A couple of people helped me with this last night but I didn't finish and went to bed. Not looking for the answer, just a hint.

Instructions: Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found".

Am I close?

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

function checkObj(checkProp) {
  if myObj.hasOwnProperty(checkProp) {return myObj[checkProp];}
else {return Not Found;}
  // Your Code Here

  return "Change Me!";
}

// Test your code by modifying these values
checkObj("gift");
madhuri soni
@sonimadhuri
Aug 12 2017 16:15
thanks @sjames1958gm the preventDefault worked
CamperBot
@camperbot
Aug 12 2017 16:15
sonimadhuri sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: sonimadhuri already gave sjames1958gm points
Stephen James
@sjames1958gm
Aug 12 2017 16:15
@sonimadhuri Great!
@mbmontana Without " or ' Not Found is not a string
@mbmontana BTW,
if myObj.hasOwnProperty(checkProp) {return myObj[checkProp];} this is not good style
if myObj.hasOwnProperty(checkProp) {
  return myObj[checkProp];
} else {
}
Mike Batista
@mbmontana
Aug 12 2017 16:20
@sjames1958gm I thought an if-else statement was the way to go here. Does Change Me! come into play at all?
Stephen James
@sjames1958gm
Aug 12 2017 16:21
@mbmontana An if/else is fine - in that case remove the return "Change Me!"
You could just do if - and then replace Change Me! with Not Found
because your if returns you don't have to have an else.
Darren
@DarrenfJ
Aug 12 2017 16:25
@emrulkayesraceme hey buddy!
@mbmontana it looks like part of one of the fCc exercises.. are you returning Change Me! just so you can see if it works?
now I'm curious.. what exercise is it? @mbmontana
Supra01
@Supra01
Aug 12 2017 16:33

I'm working on the card counting challenge in the javascript section and I was wondering if I'm on the right track
var count = 0;

function cc(card) {
// Only change code below this line
if(card >= 2 || card <= 6){
return (count++) + " Bet";
} else if ( card >= 7 || card <= 9){
return count + " Hold";
} else
return (count--) + " Hold";
// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

Darren
@DarrenfJ
Aug 12 2017 16:34
@Supra01 can't recall what it's supposed to do... gonna go check my answer brb
Supra01
@Supra01
Aug 12 2017 16:35
@DarrenfJ I appreciate that
Raceme
@emrulkayesraceme
Aug 12 2017 16:36
Hey @DarrenfJ - just trying to understand this whole gitter thing - got stuck with my code haha
Darren
@DarrenfJ
Aug 12 2017 16:37
@Supra01 some things to think about.. how to accommodate K, Q, J, A if you are doing >= and <=
@Supra01 and then whether to hold or bet is based on the count itself.. "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"
Supra01
@Supra01
Aug 12 2017 16:40
@DarrenfJ So my last bottom "else" is not catching K,Q,J,A?
Darren
@DarrenfJ
Aug 12 2017 16:40
so bet or hold are based on the absolute value of count and not the change of count

@Supra01 lemme check the logic on that one

So my last bottom "else" is not catching K,Q,J,A?

Supra01
@Supra01
Aug 12 2017 16:41
@DarrenfJ Thank you I will give it a try
CamperBot
@camperbot
Aug 12 2017 16:41
supra01 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 1966 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Aug 12 2017 16:42
@Supra01 I think yer right the last will catch the J etc.. and 10
so I think yer good there
@Supra01 didja run it as is and see if it passed? I think yer on the right track for sure I did mine totally differently, as switch statements) :D
I love seeing allthe different ways code can be coded
that said, it's time for more :coffee: and podcasts...
code on brave room
and thanks to @sjames1958gm for helping and for the brownies you missed out on ;)
CamperBot
@camperbot
Aug 12 2017 16:46
darrenfj sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8304 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Supra01
@Supra01
Aug 12 2017 16:46
@DarrenfJ no luck. I will try the switch statement
Darren
@DarrenfJ
Aug 12 2017 16:47
I always love seeing yer brownie count... yazZZZah!!!
Stephen James
@sjames1958gm
Aug 12 2017 16:47
@DarrenfJ :+1:
Darren
@DarrenfJ
Aug 12 2017 16:47
@Supra01 i htink yer close you just don't have to return after each count++ or count-- but rather
but rather then do a check to see if count is > or < zero to decide if to bet or hold
and then return count + 'bet' or whatever as necessary
Darren
@DarrenfJ
Aug 12 2017 16:52
@Supra01 also threw your code into my exercise and syntax wise yer missing a { after the else
@Supra01 ok got it to pass....
@Supra01 check your conditionals.. is it card greater than 2 or card less than 6, or is it card between 2 and 6 (including 3,4,5)
that said, it's time for more :coffee: and podcasts...
later room :D
Sleepy Mario
@SleepyMario
Aug 12 2017 17:09
hello
Albert Cardona II
@daddycardona
Aug 12 2017 17:15
LOL
Kwbena
@AoN85
Aug 12 2017 17:19
Hi All. Need some help with a nested object exercise.
The setup is:
var myStorage = {
"car": {
"inside": {
"glove box": "maps",
"passenger seat": "crumbs"
},
"outside": {
"trunk": "jack"
}
}
};
And I'm trying to use dot notation to get glove box = maps
Albert Cardona II
@daddycardona
Aug 12 2017 17:20
how are you using that notation
Kwbena
@AoN85
Aug 12 2017 17:21
var gloveBoxContents = myStorage.car.inside ["glove box"] ;
I've gotten the right response, but it's asking "Use dot and bracket notation to access myStorage"
korzo
@korzo
Aug 12 2017 17:25
@AoN85 It's ok, you can't use dot notation with "glove box"
Kwbena
@AoN85
Aug 12 2017 17:26
I realized. I've used the brackets for glove box, but supposedly I'm not accessing "myStorage" correclty
aRtoo
@artoodeeto
Aug 12 2017 17:44

hello masters!! need help. i have a problem on algorithm entitled pig latin.
how can i stop the loop when it hit another consonant?? i tried return and i cant make it work.heres my code:

function translatePigLatin(str) {
  var vowelsArr = 'aeiou'; //way
  //var constArr = 'BCDFGHJKLMNPQRSTVWXYZ'.toLowerCase(); //ay
  var uno = [];
  var dos = [];
  str = str.split('');

  if (vowelsArr.indexOf(str[0]) === -1) {
    for (var i = 0; i < str.length; i++) {
      if (vowelsArr.indexOf(str[i]) === -1) {
        dos.push(str[i]);
      } else if (vowelsArr.indexOf(str[i]) !== -1) {
        uno.push(str[i]);
        uno = uno.join('');
        dos = dos.join('');
        return uno + dos + 'ay';
      }
    }
  } else {
    return str.join('') + 'way';
  }
}

//translatePigLatin("consonant");
//translatePigLatin("california"); //should return "aliforniacay".
//translatePigLatin("paragraphs"); //should return "aragraphspay".
translatePigLatin('glove'); //should return "oveglay".

do i need to put a counter so i can count how many characters to remove? im not gonna use substr im just going to use splice.

Stephen James
@sjames1958gm
Aug 12 2017 18:05
@artoodeeto Just use your for loop to count consonants, then break; when you hit a vowel, use slice with this count to move the consonants
@artoodeeto
// This for loop will exit with i = number of consanants
for (var i = 0; i < str.length && vowelsArr.indexOf(str[0]) === -1; i++)  {}
@AoN85 I might not like that space before ["glove box"]
Daniel
@dkapexhiu
Aug 12 2017 20:17
hi, i have created a mysql database for a reactjs webapp. how to connect the database with the app?
Mike Batista
@mbmontana
Aug 12 2017 20:40

This is the third time I bring this up. The other two times I had to go away but now I have a good three hours to figure this out. Apologies to those who have seen this before.

Instructions: Modify the function checkObj to test myObj for checkProp. If the property is found, return that property's value. If not, return "Not Found".

My reasoning for this code: If myObj has the checkProp argument as a property, it should return the value of the property, which I thought I'd be getting with return myObj[checkProp].

Am I close?

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

function checkObj(checkProp) 
{if myObj.hasOwnProperty(checkProp) {return myObj[checkProp];}

  // Your Code Here

  return Not Found;
}

// Test your code by modifying these values
checkObj("gift");
Gulsvi
@gulsvi
Aug 12 2017 20:50
@mbmontana Yes, you have the logic correct, just some syntax errors to fix
if (condition goes in parentheses)
return "text strings go in quotes"
hints ^^
Mike Batista
@mbmontana
Aug 12 2017 20:57
@SkyC0der @sjames1958gm @DarrenfJ @Margaret2 @kirah1314 @revisualize Thank you for all your help on this going back to last night. Whew!
CamperBot
@camperbot
Aug 12 2017 20:57
mbmontana sends brownie points to @skyc0der and @sjames1958gm and @darrenfj and @margaret2 and @kirah1314 and @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2879 | @margaret2 |http://www.freecodecamp.com/margaret2
:star2: 1967 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 2375 | @skyc0der |http://www.freecodecamp.com/skyc0der
:star2: 8306 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 4430 | @revisualize |http://www.freecodecamp.com/revisualize
:cookie: 998 | @kirah1314 |http://www.freecodecamp.com/kirah1314
Margaret
@Margaret2
Aug 12 2017 20:58
:sparkles:
Gulsvi
@gulsvi
Aug 12 2017 20:58
:beers:
Razvan
@razvanlikespizza
Aug 12 2017 21:10
@SkyC0der Cheers! xDD
Daniel
@dkapexhiu
Aug 12 2017 21:10
how about my problem? how to create an api for react?
Razvan
@razvanlikespizza
Aug 12 2017 21:11
Go , goo,goo
GOOGLE
Gulsvi
@gulsvi
Aug 12 2017 21:15
Cheers!
@dkapexhiu You might have more luck asking in the backend or dataviz rooms
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 21:22
Hi there
Anyone who can help me with github
Daniel
@dkapexhiu
Aug 12 2017 21:31
ok thanka SkyC0der
thnx
juni
@junipberry
Aug 12 2017 21:53
I have a general question re: regEx
what is the diff bw /n and /r? Don’t they in effect do the same thing
doesn’t the carriage return create a new line
Christopher McCormack
@cmccormack
Aug 12 2017 22:26
carriage return traditionally went back to the beginning of the line
the combination could be used to start a new line and return the cursor to the beginning of the line @junipberry
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:50
Hi Chris
I have a question can you help me
if you are there
Manish Giri
@Manish-Giri
Aug 12 2017 22:51
@NidhiChandwani what's up
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:51
Help me with git hub
Manish Giri
@Manish-Giri
Aug 12 2017 22:51
what's your question
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:51
How to set up the git hub
I want to upload one project to git hub
I am unable to that
git push
command is not working
Manish Giri
@Manish-Giri
Aug 12 2017 22:52
what's the error
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:52
ok let me send you
Thanks Manish!
for your quick response side by side I am checking internet resources also
Lets see
Manish Giri
@Manish-Giri
Aug 12 2017 22:55
@NidhiChandwani that URL is broken
can you upload a screenshot of the error?
that should be more helpful
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:56
Ohh yes
mstellaluna
@mstellaluna
Aug 12 2017 22:57
@Manish-Giri :wave:
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:57
because I have deleted all repositories
Manish Giri
@Manish-Giri
Aug 12 2017 22:57
@mstellaluna yyello
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:57
I am now tired sometimes when you are unable to solve such little issues
Lets see
Manish Giri
@Manish-Giri
Aug 12 2017 22:57
um
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:57
What do you do Manish
Manish Giri
@Manish-Giri
Aug 12 2017 22:58
I'm sure it's a small thing
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:58
I also need some information if you can assist me with that
Manish Giri
@Manish-Giri
Aug 12 2017 22:58
sure
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 22:58
Are you a web developer?
Manish Giri
@Manish-Giri
Aug 12 2017 22:59
developer..not exactly web developer
I do java stuff mostly
Nidhi Chandwani
@NidhiChandwani
Aug 12 2017 23:00
Ohh Okies
Java ..That seems to me very tough!
ha ha ha
Manish Giri
@Manish-Giri
Aug 12 2017 23:00
lol
it's much easier than front end development!
Mike Batista
@mbmontana
Aug 12 2017 23:06
This time, I don't need an answer. I was correct but I don't understand why I was correct because I basically went by the example. How does this work?

// Example
var ourArr = [ 9, 10, 11, 12];
var ourTotal = 0;

for (var i = 0; i < ourArr.length; i++) {
  ourTotal += ourArr[i];
}

// Setup
var myArr = [ 2, 3, 4, 5, 6];

// Only change code below this line
var total=0;
for (i=0; i < myArr.length; i++) {total += myArr[i];}