1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
victus00 [196]
3 years ago
10

How to create json object from variables javascript

Computers and Technology
1 answer:
tino4ka555 [31]3 years ago
8 0
Not entirely sure what you want to achieve, but consider this program:

var a = 'foo';
var b = 'bar';

var c = { first : a, second : b };

console.log(JSON.stringify(c, null, 4));

A json object c is constructed using the values from variables a and b. Is this what you mean?
You might be interested in
Which statement describes how to insert the IF, COUNTIF, or SUM function into a cell?
Gre4nikov [31]

Answer:

B Type an = sign in the cell, followed by the name of the function and the relevant arguments.

Explanation:

always look for =

8 0
3 years ago
What is the difference between the (BIOS) basic.input.output.system and R.O.M
abruzzese [7]
EX: A BIOS is a file used to make an emulator work properly. <span>A ROM is a copy of a game downloadable online.</span>
6 0
3 years ago
Linda wants to change the color of the SmartArt that she has used in her spreadsheet. To do so, she clicks on the shape in the S
Julli [10]

Answer: Theme colors

Explanation:

Based on the directions, Linda most probably went to the "Theme colors" option as shown in the attachment below. Theme colors enables one to change the color of their smart shape.

It is located in the "Format tab" which is under "Drawing tools" in the more recent Excel versions. Under the format tab it is located in the Shape Styles group as shown below.

8 0
2 years ago
"What is the concept of a computer implemented as part of a larger system that is typically designed around a limited set of spe
FrozenT [24]

Answer: Embedded system

Explanation:The combination of the hardware system along with software system to perform a particular function or task is known as the embedded system. It is a specific performance device which does its working on the basis of the microcontrollers as well as microprocessors .It performs the task according to the programs that are invoked in it to do the task in a larger device.

Example:- Printers performs specific task of printing and scanning

7 0
3 years ago
Write a for loop that sets each array element in bonusScores to the sum of itself and the next element, except for the last elem
Nat2105 [25]

Answer:

The program to this question can be given as:

Program:

#include<stdio.h>  //header file.

int main()

 //main function

{

   int SCORES_SIZE = 4;  //define variables.

   int bonusScores[]={10,20,30,40};  //define array.

   int i;

   printf("Values:");

 //message

   for (i = 0; i < SCORES_SIZE; ++i)  //loop for print values.

   {

       printf("%d ", bonusScores[i]);

   }

void CombineScores(int numberScore, int userScore) //function

{

   for (i = 0; i < SCORES_SIZE; i++)

  //loop for convert values

   {

       if (( bonusScores[i] <= bonusScores[i +1] ) || (bonusScores[i] < bonusScores [i+1]))  //check array elements

       {

           bonusScores[i] = (bonusScores [i] + bonusScores[i+1]);

 //add values

       }

       else

       {

           bonusScores[i] = bonusScores[i];

       }

   }

   printf("\nReturn values:");  //message

 for (i = 0; i < SCORES_SIZE; i++)

{

printf("%d",bonusScores[i]);

}

}

CombineScores(0,0); //calling

return 0;

}  

Output:

Values:10 20 30 40  

Return values:30 50 70 40  

Explanation:

In the above c++ programming code firstly we define the header file. Then we define the main function in this function we define variable that name is given in the question that is SCORES_SIZE, i. Variable i is used in the loop for a print array. Then we define and initialize an array. The array name is and elements are define in the question that is bonusScores[]={10,20,30,40}. Then we use the loop for print array elements.Then we define function that is CombineScores() in this we pass two parameter. Then we use the second time in this loop we check array elements and add the elements that are given in the question. In this function we print values and at the end we call function.

3 0
3 years ago
Other questions:
  • Read three integers from user input. Then, print the product of those integers. Ex: If input is 2 3 5, output is 30. Note: Our s
    6·1 answer
  • Which type of system would be more reliable for keeping a plane traveling at constant speed – an automatically controlled feedba
    11·1 answer
  • When we insert a new node into a red-black tree, we set the color of the newly inserted node n to red. observe that if we had ch
    15·1 answer
  • Discuss some design considerations that you should keep in mind when you want to design a professional-looking flyer or newslett
    12·1 answer
  • Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print o
    6·1 answer
  • Can someone tell me? I have an assignment in C++: I have to do three codes please tell me should i do them in one project or in
    12·1 answer
  • What is the purpose of the Zoom dialog box? to put the selected range in ascending order in a query to put the selected range in
    13·2 answers
  • Can someone send me reference on communication, importance , communication cycle , pros and cos​
    15·1 answer
  • What will be displayed after this code segment is run?
    5·1 answer
  • What information will she need to know in order to obtain assistance from the chief medical officer to reduce the number of deli
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!