• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 773
  • Last Modified:

returning array from function in Javascript

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
Victor Kimura
Asked:
Victor Kimura
  • 2
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
0
 
Victor KimuraSEO, Web DeveloperAuthor Commented:
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
 
leakim971PluritechnicianCommented:
No, I'm speaking Javascript with Eclipse or at least PHPEd, I don't know PHPStorm
0
 
Victor KimuraSEO, Web DeveloperAuthor Commented:
Ok, just thought you may know. Thanks, leakim971!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now