loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.15716237519674103","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"Ly9TZXR1cAp2YXIgY29udGFjdHMgPSBbCiAgICB7CiAgICAgICAgImZpcnN0TmFtZSI6ICJBa2lyYSIsCiAgICAgICAgImxhc3ROYW1lIjogIkxhaW5lIiwKICAgICAgICAibnVtYmVyIjogIjA1NDMyMzY1NDMiLAogICAgICAgICJsaWtlcyI6IFsiUGl6emEiLCAiQ29kaW5nIiwgIkJyb3duaWUgUG9pbnRzIl0KICAgIH0sCiAgICB7CiAgICAgICAgImZpcnN0TmFtZSI6ICJIYXJyeSIsCiAgICAgICAgImxhc3ROYW1lIjogIlBvdHRlciIsCiAgICAgICAgIm51bWJlciI6ICIwOTk0MzcyNjg0IiwKICAgICAgICAibGlrZXMiOiBbIkhvZ3dhcnRzIiwgIk1hZ2ljIiwgIkhhZ3JpZCJdCiAgICB9LAogICAgewogICAgICAgICJmaXJzdE5hbWUiOiAiU2hlcmxvY2siLAogICAgICAgICJsYXN0TmFtZSI6ICJIb2xtZXMiLAogICAgICAgICJudW1iZXIiOiAiMDQ4NzM0NTY0MyIsCiAgICAgICAgImxpa2VzIjogWyJJbnRyaWd1aW5nIENhc2VzIiwgIlZpb2xpbiJdCiAgICB9LAogICAgewogICAgICAgICJmaXJzdE5hbWUiOiAiS3Jpc3RpYW4iLAogICAgICAgICJsYXN0TmFtZSI6ICJWb3MiLAogICAgICAgICJudW1iZXIiOiAidW5rbm93biIsCiAgICAgICAgImxpa2VzIjogWyJKYXZhU2NyaXB0IiwgIkdhbWluZyIsICJGb3hlcyJdCiAgICB9Cl07CgpmdW5jdGlvbiBsb29rVXBQcm9maWxlKG5hbWUsIHByb3ApewogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250YWN0cy5sZW5ndGg7IGkrKykgewogICAgICBpZiAobmFtZSA9PT0gY29udGFjdHNbaV0uZmlyc3ROYW1lICYmIGNvbnRhY3RzW2ldLmhhc093blByb3BlcnR5KHByb3ApID09PSB0cnVlKQogICAgICAgIHJldHVybiBjb250YWN0c1tpXVtwcm9wXTsKICAgICAgZWxzZQogICAgICAgIHJldHVybiAiTm8gcG9pbnRzIjsKICAgIH0KLy8gT25seSBjaGFuZ2UgY29kZSBhYm92ZSB0aGlzIGxpbmUKfQoKLy8gQ2hhbmdlIHRoZXNlIHZhbHVlcyB0byB0ZXN0IHlvdXIgZnVuY3Rpb24KbG9va1VwUHJvZmlsZSgiQWtpcmEiLCAibGlrZXMiKTs="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//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){
    for (var i = 0; i < contacts.length; i++) {
      if (name === contacts[i].firstName && contacts[i].hasOwnProperty(prop) === true)
        return contacts[i][prop];
      else
        return "No points";
    }
// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");
Native Browser JavaScript