0
votes
1answer
50 views

How can a function be added as a key-value pair in an object?

I am working on the following code, and some sort of error is being found on the adding of 3 key-value pairs in the myData object: var myArray = ["Francisco Souza Homem de Mello","franciscomello"]; ...
1
vote
1answer
50 views

Running object property function in a loop

I am iterating through an object and comparing the property names against a given parameter; if there's a match, I want the property function to be executed. How would I call it other than explicitly? ...
0
votes
4answers
99 views

Why can't I set a JavaScript function's name property?

I am learning JavaScript and read that functions are like objects and can have properties set like this: var person = function(){ } person.name="John Smith"; //output "" person.age=21; //output 21 ...
0
votes
3answers
94 views

JavaScript global callback functions are not called?

I'm building a small web app with a few other people. I want to allow the other developers to define a couple of functions that are always called when the document is ready. Our app inserts the ...
0
votes
1answer
115 views

I need to Pop an item off of a Stack into a variable and Push the original Variable onto another Array

I have 2 Arrays and a Variable. I am able to push an item into a variable, and then on a second click, add it to an Array. However, i have another button that moves an item from that Array, back into ...
5
votes
2answers
16k views

Pass object to javascript function

I have recently been messing around with jQuery on my website, and I have a fairly limited knowledge of Javascript. I am beginning to like the jQuery ability to pass variables to a jQuery function ...
0
votes
1answer
115 views

creating function in an object in javascript

i have a program and i was thinking to create an object then a function inside it. is it possible? it's like this var x = function() {....} and i wanted to re use the variable x.. here's the code: ...