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 6604189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:07:16+00:00 2026-05-25T19:07:16+00:00

dont laugh think im having a long day work blonde moment as im a

  • 0

dont laugh think im having a long day work blonde moment as im a bit out of practice with JS. Any helped appreciated for what I think is a stupidly simple problem.

optionarray = [];

for(i=0;i<response.length;i++) {

    optionarray[i]['content'] = response[i]['name'];
    optionarray[i]['value'] = response[i]['id'];
}

I keep getting optionarray[i] is undefined when trying to add it to the array and build it. I know im doing something ridiculously stupid I just can’t remember what 🙂

Many thanks for any help in advance.

  • 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-25T19:07:17+00:00Added an answer on May 25, 2026 at 7:07 pm
    optionarray = [];
    
    for(i=0;i<response.length;i++) {
    
        optionarray[i] = {
                'content' :response[i]['name'], 
                'value': response[i]['id']
        };
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I dont think this is possible in c# but ill post it anyway. Given
lazy dont have to read this I have to work on an old netbeans
I dont get why this simple line of code does not work: <?php $someVariable
I'm using Delphi 1 16-bit to learn Pascal (don't laugh, it works fine, plus
Firstly, dont laugh, I know it is basic. I have this code: if ($pageid
I'm sure folks will get a good laugh out of this one, but for
Here's a stupid question, don't laugh, I've been trying to figure this out but
I dont know if this is possible. In SSIS Derived column transformation, can you
I dont really know how to explain exactly what function i need but ill
I dont know how to debug structures like: fun1 <- function(obj){ a<-c(obj,4) c(a,5) }

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.