If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

you have a 2 simple errors in your code
the first one as xelawho said all variables in your code are string, so they should be marked like thispronoun === 'yo' or pronoun === "yo"
and so for type === 'a' or type === "a"

second error at last part of code else (pronoun === 'yo' && type === 'i')
because last eles desn't need a conditionelse {........}
or make it else ifeles if(pronoun === 'yo' && type === 'i') {........}
so your code will be like this

I'm not criticizing you and I think it's great that you're getting into coding so early. You will be a total ninja by the time you are 20 if you keep going. But if you are going to ask questions it's polite to read the answers and try not to repeat the same mistake. Doesn't matter how old you are, and anyway you will learn faster that way.

In the code I showed you verbs is an object (pretty much everything in javascript is an object, so you should get used to working with them).

Objects have keys and keys have values. Yo, tu, el, etc are keys, but here each value is another object. Within the yo object a, e and i are keys and "o", "e" and "o" are their respective values.

You can access an object's values in two ways: dot notation -

Code:

alert(verbs.yo.a) // returns "o"

or array notation -

Code:

alert(verbs["yo"]["a"]) // returns "o"

They return the same thing, but if you are trying to access object values with variables (as you do in your code) you can't use dot notation, but you can use array notation. In plain English, this:

Code:

verbs[pronoun][type]

says return the value corresponding to the key that matches the "type" variable from the object that matches the "pronoun" variable from within the verbs object.