0

the problem is error that i got in chrome console

I just want to have access for these items dynamically with the help of argument of my function

this is my JS code

function response(name){
    var member = mytable.name;
    console.log(name);
    var resp = name +' is a '+ titul;
    return resp;
}

this is my json hash

mytable = {
    "Anton Buday": {
        "titul": "Phd student",
        "staff_member": "Ing. Anton Buday",
        "translation": "Антон Будай",
        "job_title": "denný doktorand",
        "office": "",
        "building": "BN32",
        "mail": "anton.buday@tuke.sk",
        "landline": "+421 55 602 2298"
    },
    "Gabriel Bugar": {
        "titul": "assistant professor",
        "staff_member": "Ing. Gabriel Bugár, PhD.",
        "translation": "Габріел Бугаар",
        "job_title": "odborný asistent",
        "office": 515,
        "building": "BN32",
        "mail": "gabriel.bugar@tuke.sk",
        "landline": "+421 55 602 2808"
    }
}

I already tried it but, the same error occured mytable[name] same error occurred ( thanks everyone for help

0 Answers0