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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:48:51+00:00 2026-05-31T17:48:51+00:00

I have taken the following object as an example: var questions = { 1:

  • 0

I have taken the following object as an example:

var questions = {
   "1": {
       "question": "What animal goes 'woof'",
       "a": "Duck",
       "b": "Cat",
       "c": "Dog",
       "answer": "Dog"
   },
   "2": {
       "question": "What color is a giraffe",
       "a": "Yellow",
       "b": "Orane",
       "c": "Blue",
       "answer": "Yellow"
   },
   "3": {
       "question": "What is 2 + 2",
       "a": "6",
       "b": "4",
       "c": "9",
       "answer": "4"
   },
   "4": {
       "question": "What is 4 + 8",
       "a": "12",
       "b": "17",
       "c": "100",
       "answer": "12"
   },
   "5": {
       "question": "What is 4 - 1",
       "a": "5",
       "b": "91",
       "c": "3",
       "answer": "3"
   }
};

I would like to shuffle these questions in a particular way.

I would like to maintain the property name’s and order (1,2,3 .etc.), but shuffle the values.

So the first property of ‘questions’ would still be “1” but the object containing the “question”, “a”, “b”, “c”, “answer” would be shuffled.

Hopefully that make’s sense, just ask if I’ve been unclear. Thanks in advance guys!

  • 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-31T17:48:53+00:00Added an answer on May 31, 2026 at 5:48 pm

    Firstly, I don’t see the point in having the “1”, “2”, “3” properties at all, your array just needs to be an array of the question objects. The one at the first index (0) is “1”, the second index is “2”. This can be inferred by position.

    var question = [{question 1 data}, {question 2 data}];
    

    Once you’ve done that and simplified it, you can use a shuffle function like the one described here.

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

Sidebar

Related Questions

Suppose I have a the following in Scala object Foo { var functions: List[String
I have the following piece of code taken from the PHP manual on the
i have the following code, taken partly from a Red Black Tree Java implementation.
Take the following example, I have a class public class SomeItem { public string
I have taken the MailComposer example added to a simple project and under a
If I have a javascript object that looks like the following: { 0: [0,50],
I have the following code (taken from actual script): $result=mysql_query($sql); while($row=mysql_fetch_assoc($result)) { $auth_token=$row['oauth_token']; $auth_token_secret=$row['oauth_token_secret'];
Take the following minimal example: import abc class FooClass(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod def
I have the following function (taken from Elevation Service @ Google Maps API )
I have following datas: var formFeilds={ 'text': { 'T1':{'required':true,'min':25,'max':55}, 'T2':{'required':true,'min':2,'max':5} } ,'text2':5 }; 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.