0
undefined. I can't understand?
var name = prompt("Write your name: "); var age = prompt("type your age: "); function FucGetDate(){ var person = []; person[name]; person[age]; document.write(person[age]) } FucGetDate()
3 Answers
+ 4
You have not assigned the name and age variables to your person array.
Maybe you meant something like:
person['name'] = name;
person['age'] = age;
+ 1
James is correct you need to assign the values of age and name to your array
0
person[0]=name;
person [1]=age;