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

what can I wite to a friend about his hobby? ​
Find the value of x for which ABCD must be a parallelogram.
If u delete discord on ur phone and use your laptop to call someone through discord will the call record show on your phone?
Physics help please
Am I right ? And if I wrong , which one ?
Is being an American a matter of choice or geography?
How was John Wesley Powell's experience in the Grand Canyon different from the experience that visitors have at the Grand Canyon today?
An insurance company sells a homeowner's insurance policy that is $600 per year per policy. The insurance company predicts that the probability of having a home
The expression 2x³+ ax² + bx-30 is divisible by x + 2 and leaves a remainder of -35 when divided by 2x-1. Find the values of the constants a and b. I will give
how can the media contribute to the social and political transformation explain with example