Link to home
Start Free TrialLog in
Avatar of Victor Kimura
Victor KimuraFlag for Canada

asked on

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<><
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor Kimura

ASKER

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?
No, I'm speaking Javascript with Eclipse or at least PHPEd, I don't know PHPStorm
Ok, just thought you may know. Thanks, leakim971!