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

  • Home
  • SEARCH
  • 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 7538207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:03:49+00:00 2026-05-30T07:03:49+00:00

I’m not even sure if this is bad practice or not and needs changing,

  • 0

I’m not even sure if this is bad practice or not and needs changing, but want to make sure. It doesn’t seem to impact performance at all.

I have a plugin that has many options. The user can enter options in the following format:

speed: "in,out > in,out > in,out"

Each group of “in,out” settings applies to an HTML element being animated – separated by the “>”. The above is setting the animation on/off speed for 3 different objects. Everything works perfectly across all browsers now, but I’ve had to create a ton of arrays to handle all of the settings. Basically there’s an array that holds all of the speed_in settings (object1, object2, object3), speed_out, effect_in, etc…

Basically, I have a block of code that is nothing but creating arrays for these sets, like so:

var speed_in_set = [], speed_out_set = [], effect_in_set = [], effect_out_set = [] ....

The array names are based off of the original default setting names:

speed: ... effect: ...

My best guess to make this more efficient is to iterate over the defaults key names and append _on_set and _off_set to create a new array for each one, but have no idea how to do that and if I even need to worry about have too many arrays.
Thanks!

  • 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-05-30T07:03:51+00:00Added an answer on May 30, 2026 at 7:03 am

    JSON is an excellent technique for complex array structures, particularly for value/name pairs. Widely used and fast.

    EDIT: example.

    You can add more properties by adding more elements, instead of creating a new array. Do some searched on JSON on this site and you’ll fine some interesting examples. I have one dataset called “data”, but you can add others for other purposes, all in on JSON object. It’s really like having a small database.

    <script type='text/javascript'>
    var myData = {"data":[
         {'speed_in_set':10,'speed_out_set':5,'effect_in_set':15,'effect_out_set':200.1},
         {'speed_in_set':15,'speed_out_set':5,'effect_in_set':15,'effect_out_set':200.1, 'color':'red'}
         ]
    }    
    
    alert(myData.data[0].speed_in_set)
    alert(myData.data[1].speed_in_set) 
    alert(myData.data[1].color)   
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to construct a data frame in an Rcpp function, but when I
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.