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
zootechdrum
@zootechdrum
@khaduch thanks man
CamperBot
@camperbot
zootechdrum sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3873 | @khaduch |http://www.freecodecamp.org/khaduch
zootechdrum
@zootechdrum
@sjames1958gm and thank you too
CamperBot
@camperbot
zootechdrum sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9195 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
zootechdrum
@zootechdrum
function lookUpProfile(firstName, prop){
// Only change code below this line
  for(var i = 0; i < contacts.length; i++){
       if (contacts[i].firstName === firstName & contacts[i].hasOwnProperty(prop)){
         return contacts[i][prop];
      }else if(contacts[i].hasOwnProperty(prop) === false){
        return "No such property";
      } 
    }
  return "No such contact"; 

}

// Change these values to test your function
lookUpProfile("Akira", "address");
This was acceptable. After I ready your what you wrote 10X something clicked .
creator0323
@Amasian

What do I need to add to the API provide the information of my location? I know I am missing something but I am not sure what it is. Any help will appreciated.

https://codepen.io/Amasian/pen/LdqwRY?editors=0010

Aditya
@ezioda004
@Amasian You need to make use of Navigator object which fetches geo-location of the user. Heres the fcc challenge that'll help you out. Its another Async request so make sure you get geo-location of user before you make request from the weather API.
creator0323
@Amasian
@ezioda004 ah so I need to deliver information of current user location with geolocation API! thank you so much!
CamperBot
@camperbot
amasian sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 535 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Ken Haduch
@khaduch
@zootechdrum - well, it might be passing the test, but it might just be a little bit "lucky" dependent on the structure of the test data. Oh, and there is a slight problem in the code that you posted. First, the conditional testing if (contacts[i].firstName === firstName & contacts[i].hasOwnProperty(prop)){ the operator for the "AND" operation should really be &&, a logical AND test. But with the test data as it is, it works.
The data or test could be constructed that would fail, for example for the "Bob", "number" case, if one of the contacts on the list did not have a number property, your first conditional test would never pass (because there is no "Bob"), so it would always look at the second else if and if there was a contact record without a number property, it would return "No such property", instead of the No such contact. So it's just a matter of the data just working out right. You could experiment with this by changing the data (temporarily) for example making the record for "Sherlock" have a "numbers" property instead of "number" - it will then fail that "Bob" test in the list.
Just some other things to consider when you are evaluating how to solve the problem.
Michael
@g4m3rm1k3
There is so much of this bootsrap I cannot get to work such as corner round
zootechdrum
@zootechdrum
just wondering if there is a better way to add a horizontal line on the right side of my image.
here is the link to my codepen
Stephen James
@sjames1958gm
@zootechdrum Horizontal? Or vertical?
zootechdrum
@zootechdrum
vertical
@khaduch thats going to take time to rap my head around lol
let me think about it
Stephen James
@sjames1958gm
@zootechdrum I would probably wrap another div around the img and use its right border
wei_xin1
@Wastexin
@Mera77 how can i get the caption , video has not this option.what software can
do that onlineq
Stephen James
@sjames1958gm
That avoids the height: 2000px and uses the images height
Dhaval Vira
@dhavalveera
is there any Back-End Developer is here then plz Ping me
Ken Haduch
@khaduch
@zootechdrum :point_up: April 12, 2018 9:14 PM - yeah, it might. It took me a little while to think of a case where they could set up data that would not be properly handled by your code. I'm always amazed at the kinds of things that people who are really involved in testing systems have to think of to uncover all of the strange cases that might occur. But if you have some time to spend on it and have questions, ask away!
zootechdrum
@zootechdrum
@khaduch Yeah, now i see what you mean
and i see where it could go wrong
I would have to check if the name exists at all. I could use another && statement on the second conditional and check if the name that it iterates through is the same as the param passing in but does not have the prop value to execute "no prop exist"
@sjames1958gm hey
I tried doing that but for whatever reason my vertical line changes to an off white color
zootechdrum
@zootechdrum
here is the current codepen
why it's not running ?
chompoo500ml
@chompoo500ml
@roxxlen look like you didnt pass callback function to place
roxxlen
@roxxlen
how can i do it
Aditya
@ezioda004
@roxxlen May I ask why are you invoking place() twice, initially without an argument and later with an argument? You shouldnt be invoking it twice, so you can remove the first call inside $(document).ready(function){}
In your $.ajax call you have a typo, sucess should be success. Second navigator.geolocation.getCurrentPosition(sucess, error); in this method, error callback function isnt defined and finally that data you receive from $.ajax() is JSON and not an object, so you need to parse that in order to use that as an object. JSON.parse(data) would do the job.
here is the original code
i've fixed the typo and added a error function
for this instance, the api already return a object , so there seems no need to parse it
should i give the second call a new function name ?
Ken Haduch
@khaduch

@zootechdrum - the simplest way (in my opinion) to do that check is this:

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

so if you have a firstName match, then you check for the property and make the appropriate return. If you don't have a firstName match, you let the for loop do the next iteration and so on...

Aditya
@ezioda004
@roxxlen This one doesnt seem to work at all? Theres no error in the console, but not sure where its going wrong.
roxxlen
@roxxlen
yep.... i just ripped out of those hidden buttons, stucked on the call function
Aditya
@ezioda004
@roxxlen invoking place() seems to make it work. The API is responding slowly.
zootechdrum
@zootechdrum
@khaduch netsed if gocha
roxxlen
@roxxlen
@ezioda004 no , it's not
Aditya
@ezioda004