Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

returning array from function in Javascript

Posted on 2014-02-06
4
Medium Priority
?
732 Views
Last Modified: 2014-02-06
Hi,

I'm wondering why the following does not work:

    var aRetCalFinalAmt = [];
    aRetCalFinalAmt['final_amount'] = final_amount;
    aRetCalFinalAmt['monthlypayentamt'] = monthlypayentamt;
    aRetCalFinalAmt['sPackageName'] = sPackageName;
    aRetCalFinalAmt['desire_payment_month'] = desire_payment_month;
    aRetCalFinalAmt['shipping'] = shipping;
    return aRetCalFinalAmt;

Open in new window


How do I return the array?

Thank you<><
0
Comment
Question by:Victor Kimura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 39839519
0
 

Author Comment

by:Victor Kimura
ID: 39839740
Ok, thanks, leakim971! For some reason, the PHPStorm IDE has some warning that states "Return expression type Array is not assignable to type array".

but it returns successfully. Do you know what that is?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39839750
No, I'm speaking Javascript with Eclipse or at least PHPEd, I don't know PHPStorm
0
 

Author Comment

by:Victor Kimura
ID: 39839836
Ok, just thought you may know. Thanks, leakim971!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question