Tell us what’s happening:
So im running into the same issue over and over, i thought carrying on would resolve it. what does this line of code do? it comes up again and again and really struggle to understand how exactly “contact.length” has anything to do with looking up the contacts. how x++ (x=x+1) has anything to do with it.
(var x = 0; x < contacts.length; x++){
i dont know, ive been following the exercises and they just completely lost me about half way through the Basic Javascript curriculum.
on that note, is there a collection of coding exercises that i can go do to deepen my understanding of what has been learned so far? thanks a lot for any input
Your code so far
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["JavaScript", "Gaming", "Foxes"]
}
];
function lookUpProfile(name, prop){
// Only change code below this line
// Only change code above this line
}
// Change these values to test your function
lookUpProfile("Akira", "likes");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/profile-lookup