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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:21:11+00:00 2026-05-14T05:21:11+00:00

Well, I’m completely new to JavaScript. Can you please tell me what type of

  • 0

Well, I’m completely new to JavaScript.
Can you please tell me what type of data is this JavaScript code:

var options =
{
    sourceLanguage: 'en',
    destinationLanguage: ['hi', 'bn', 'fa', 'gu', 'kn', 'ml', 'mr', 'ne', 'pa', 'ta','te','ur'],
    shortcutKey: 'ctrl+g',
    transliterationEnabled: true
};

I’ve reviewed JavaScript arrays, but it doesn’t seem to be a traditional array.
Still don’t know if it’s some kind of arrays or another data type!!

Additionally, is there any way to set individual elements to that data type such as setting array elements individually.

Thanks 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-14T05:21:11+00:00Added an answer on May 14, 2026 at 5:21 am

    This is a way of creating and initialising an object in javascript called an object literal. Since javascript is dynamically typed, you can add key/values at any time, even to the built in objects.

    The equivalent code for this would be:

    var options = {};
    options.sourceLanguage = 'en';
    options.destinationLanguage = ['hi', 'bn', 'etc'];
    

    The square brackets [] denote an array. The equivalent for this would be

    var destinationLanguage = [];
    destinationLanguage.push('hi');
    destinationLanguage.push('bn'); //etc
    

    You access array elements by index eg destinationLanguage[0].

    As you can see it is much more readable and convenient to to initialise everything using the notation in your request.

    This notation forms the basis of something called JSON (Javascript Object Notation) which is wire format for passing information eg between client and server. The string in your example could be retrieved via an AJAX request and parsed in a number of ways into a complex object.

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

Sidebar

Related Questions

Well, this is my first post here and really enjoying the site. I have
Well, it seems simple enough, but I can't find a way to add a
Well this is incredibly frustrating. After being nagged by Rails that I need to
well i have this messages table with sample values like these: msg_id recipient_id read
Well the subject is the question basically. Are there any version control systems out
Well, i've got a nice WPF book its called Sams Windows Presentation Foundation Unleashed.
Well behaved windows programs need to allow users to save their work when they
Well, after a long time writing .net programs in C# I started to feel
Well... simple question, right? But with no so simple answers. In firefox i use
Well, what is one?

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.