I get error “unexpected identifier”. What am I doing incorrectly and what is the proper method of including an object in an array using the 2 methods to call an object?
Javascript is an Async langauge. Meaning it goes from top to bottom. So at the top it dosent recognize wat cat is when you assign it to the myArray; What you can do instead is…
Which pushes it to the array…[quote=“webmaster34593, post:1, topic:41276”]
I get error “unexpected identifier”.
[/quote]
Hmm lets take a look at that code:
Notice something when you are assigning? This is the syntax:
Doesn’ this ust push an element of the function to the array, how do you push the function itself?
I don’t understand what you’re doing with the second portion unless you’re noting the missing comma?
Was that the only error in syntax that you were noticing?