Some problem output is not showing

var contacts = [



        "lastName": "Laine",

        "number": "03930953",

        "likes": ["Pizza","Coding","Brownie Points"]




        "lastName": "Potter",








        "likes":["Intriguing Cases","Violin"]      









function lookUpProfile(name, prop){

    for(var i = 0; i < contacts.length; i++){

        if(contacts[i].firstName === name){

            return contact[i][prop] || "No such property"



    return "No such contact"


var data = lookUpProfile("Akira","likes");


edit :show no error in visual studio code

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.


you need to use console.log() to see the output
document.write() change the html of a page, but there is no html to change here