Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Hello911
@Hello911

@jdtdesigns

 for(var i=0;i<contacts.length;i++){
   if (contacts[i].firstName==firstName){

     if (contacts[i][prop]){
       return contacts[i][prop];
     }else return "No such property";


   }else return "No such contact";
 }

Still, tho, not all the requirements are met.
.

MaxLAB
@Max-LAB
@jdtdesigns .attr("href", "http link"); got it.. nice approach :+1:
JD Tadlock
@jdtdesigns
@Hello911 You don't need the else for no such contact
just place that outside the for
@Max-LAB ;)
Hello911
@Hello911
@jdtdesigns GOT IT. challenged completed. thank you.
CamperBot
@camperbot
hello911 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 876 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
@Hello911 welcome
Chris
@bestintown23
how do i make the footer of my page to be on the bottom? its appearing in the middle.
JD Tadlock
@jdtdesigns
@bestintown23 the page needs to have enough content to push the footer down
if there's not enough content there are tricks you can do to make the footer always stay at the bottom
Baillie O'Grady
@baillieogrady
Chris give it a height and the body/parent a height , I personally use flexbox with a column layout then flex-grow the second to last item
Jennifer
@jchiang7874

I'm working on my random quote machine and it works great UNTIL I double click on the 'New Quote' button. :worried: Instead of clearing previous quotes, it appends to it. Any help is appreciated. Thanks!

https://codepen.io/jchiang7874/pen/YNQNeq

Also, I'm still iffy on APIs, can anyone recommend any tutorials? Thanks.
Tyler Moeller
@TylerMoeller
@jchiang7874 Looks like you fixed it with:
      $(".quote").html("");
      $(".author").html("");
Another way is to use .empty(): https://api.jquery.com/empty/
Ian Lee
@asparism
does anyone know why the promise in this Codepen doesn't work on .then()? http://codepen.io/Asparism/pen/PWPrMK?editors=0011
Mario Galindo
@mariogalindov

Hi there is there a way to make all thumbnails the same height?

http://codepen.io/magv89/pen/xgVoqj?editors=1100

Tyler Moeller
@TylerMoeller
@jchiang7874 I see the problem now...with the double click. Add that .html("") code as the first line of your getJSON function, right before you add the quote and author text.
Tyler Moeller
@TylerMoeller
@mariogalindov It can be a little complicated because the grid controls the width of the images, so if they have different aspect ratios, they get clipped or distorted. Here are a few approaches: https://scotch.io/bar-talk/different-tricks-on-how-to-make-bootstrap-columns-all-the-same-height
I think the easiest way, when dealing with only a handful of images, is to just edit them in a photo editor so they are all the same size.
Ian Lee
@asparism
@mariogalindov you could use max-height, but the slash thumbnail is a different shape than the others, so that particular thumbnail will always be different height or width than the others unless you edit the actual image, or you could put it in a div with a black background, so you would have black bars on either the top/bottom or left/right. if it's possible to make the image bigger without losing quality, you could make the container overflow: hidden;
Jennifer
@jchiang7874
@TylerMoeller Thank you! :+1: It worked but why?
CamperBot
@camperbot
jchiang7874 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1385 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
@jchiang7874 It takes some time to go out to the quotes API server and get the quote (a few hundred milliseconds). All of the code inside your getJSON function runs after the response from the quotes API server is complete. The code outside of it runs immediately. So, you were clearing contents that had already been cleared while waiting to get the updated quote text - if that makes sense ;)
why my navigation bar menu is not changing upon scrolling
Baillie O'Grady
@baillieogrady
Mrs-coder what are you trying to achieve?
mrs-coder
@mrs-coder
trying to change the navigation bar menu change upon scrolling . Like if we scroll till contact me, then Contact menu on the navigation bar becomes active
armynational
@armynational
hey so im trying to put a background image on my personal portfolio and everything looks right but its not working any help\
detour26
@detour26
Hey everyone, I am trying to do the Personal portfolio challenge and I cant figure out how to (1) get the background image to fit the screen and (2) get the website to scroll up and down.....Any suggestions? thanks
armynational
@armynational
theres a tutuorial on youtube that has helped ,me alot the channel is called code tutorials360
@detour26
detour26
@detour26
@armynational Thanks, I'll go ahead and take a look
CamperBot
@camperbot
detour26 sends brownie points to @armynational :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for armynational
Mois├ęs Man
@moigithub
This message was deleted
Mario Galindo
@mariogalindov
thanks @TylerMoeller I saw the posibble solutions but I think the best I can do for now is to change the image of the thumbnail, thanks to you too @asparism I tried the max height but I do want all of them to be the same size.
CamperBot
@camperbot
mariogalindov sends brownie points to @tylermoeller and @asparism :sparkles: :thumbsup: :sparkles:
:cookie: 304 | @asparism |http://www.freecodecamp.com/asparism
:star2: 1386 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
Tyler Moeller
@TylerMoeller
@mrs-coder What you're looking for is called Scroll Spy. Here are the instructions: http://getbootstrap.com/javascript/#scrollspy
John Nunns
@johnnunns
hey guys just need a little help here:
function getCount(str) {
  var vowelsCount = 0;

  str.split(' ')
  switch (str){
    case "a": vowelsCount + 1;
    break;
    case "e": vowelsCount + 1;
    break;
    case "i": vowelsCount + 1;
    break;
    case "o": vowelsCount + 1;
    break;
    case "u": vowelsCount + 1;
    break;
    };

  return vowelsCount;
}
just need to return the vowel count in a given string
probably not using the split property correctly though
c0d0er
@c0d0er
could anybody help for the following 2 questions?
var arr = [              
    [0,0,0]
];
var x=[...arr, [1,1,1,]]
console.log(x)//[ [ 0, 0, 0 ], [ 1, 1, 1 ] ]
x[0][0]=1;
console.log(x)//[ [ 1, 0, 0 ], [ 1, 1, 1 ] ]
console.log(arr)//[ [ 1, 0, 0 ] ]---> why use spread operator, the arr element is still changed?
var arr = [              
    [0,0,0]
];
var x=arr.concat([[1,1,1]]);
console.log(x)//[ [ 0, 0, 0 ], [ 1, 1, 1 ] ]
x[0][0]=1;
console.log(x)//[ [ 1, 0, 0 ], [ 1, 1, 1 ] ]
console.log(arr)//[ [ 1, 0, 0 ] ]---> why use concat, the arr element is still changed?
Tyler Moeller
@TylerMoeller
@johnnunns Correct, .split(' ') will separate your string by spaces rather than characters. Use str.split('') instead. You could then to a str.split('').map to loop through the string and evaluate each character.
@c0d0er Not sure how to answer that question - I'd have to know the context.