daltonduh7757 daltonduh7757
  • 15-12-2017
  • Computers and Technology
contestada

how to create json object from variables javascript

Respuesta :

tonb
tonb tonb
  • 15-12-2017
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?
Answer Link

Otras preguntas

A prejudice differs from a stereotype in that it includes ____.​
What was the main point of ivan pavlov�s experiment with dogs? question 1 options: a. behavior is motivated by the consequences we receive for the behavior: rei
Can u round 1685 to the nearest hundred
Johnny is designing a rectangular poster to contain 36-in squared of printing material with a 1 ​-in margin at the top and bottom and a 1 ​-in margin at each si
Tori and jamil are a married couple who receive aid from the temporary assistance to needy families (tanf) program. in the late 1990s, their social worker encou
I started the bottom question but I don’t understand how to finish it...
In the number 956,783,529, how does the value of the digit 5 in the ten millions place compare to the digit 5 in the hundred place?
which of the following does not illustrate an effective way of coping with major frustration
A 64-cm strip is cut into eight equal pieces . What is the length in mm of one piece
Explanatory terms in a sentence are often enclosed by A. parentheses. B. hyphens. C. semicolons. D. commas.