Solved

returning array from function in Javascript

Posted on 2014-02-06
4
705 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
  • 2
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
0
 

Author Comment

by:Victor Kimura
Comment Utility
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
Comment Utility
No, I'm speaking Javascript with Eclipse or at least PHPEd, I don't know PHPStorm
0
 

Author Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now