Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8335059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:33:00+00:00 2026-06-09T03:33:00+00:00

I have a JavaScript array that contains 150 JavaScript functions (these functions return financial

  • 0

I have a JavaScript array that contains 150 JavaScript functions (these functions return financial indicators). when i load my page, i have this array. I’m wondering is it possible to use these loaded functions on that page?

I’ve converted my array to string and picture below shows how it looks like in alert mode:

arry alert mode http://bsl.site40.net/pic/8cdf49ea54ee.jpg

In above picture the (faunction a, b, c) are where my functions take place and there is 150 functions (the string {“itemCode”:___}, will be repated each time i ad a function). I think there should be some string replace and then inserting the functions on that page in someway. mmm i don’t know. can you help me?
I have another question: is it possible for a javascript array to be very long (for example 20000 characters)?

Edit: my array has complete code of functions. in that picture i showed only their name in order to picture be viewable

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:33:03+00:00Added an answer on June 9, 2026 at 3:33 am

    I would suggest you use a json object instead of an array, it will be easier to look up.
    If you keep using an array you will have to loop over the array in order to find the correct functionname/function.

    If your json object holds function names that are declared globally you can call them like this

    var functionName = "myFunc";
    window[functionName]();
    

    But you probably should not declare your functions globally but store them in some sort of namespace.

    If your json object contains the actual function ( and i would recommend this ), you can call it with

    var functionName = "myFunc";
    myObject[functionName]();
    

    If your object contains the function code as a string, you will have to eval it to execute it. Your function will need to be wrapped in parentheses, i would not suggest this method !
    You would be even better off to dynamically load the functions with some sort of jsonp.

    var functionName = "myFunc";
    var myFunc = eval('(' + myObject[functionName] + ')');
    myFunc();
    

    An array can contain a maximum of 4,294,967,296 elements, but you will have obliterated your performance long before you reach that, i’m not so sure about json objects tough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this JavaScript string that contains and array of malformed JSON and I
I have an array in javascript. This array has strings that contains commas (,).
I have a variable length array of strings declared in javascript that contains Dungeons
I have this array, that I want to parse into javascript. $offerText[] = (
I'd like to have an array in javascript that each item contains 2 properties
I have an external JavaScript that contains: function random_imglink(){ var myimages=new Array() myimages[1]="http://sevir.sitegoz.com/jchs/Banner1.png" myimages[2]="http://sevir.sitegoz.com/jchs/banner2.png"
I have a global JavaScript array that contains some strings. I want to create
I have a numeric javascript array, that contains several objects with geodata in it.
I often have the need to search a javascript array that contains objects. I
I have a Javascript class that contains a few functions and member objects: function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.