I have got a JSON:
let jsonName = '{"name1": "John", "name2": "Billy", "name3": "Tristan"}';
let jsonSurname = '{ "surname1": "Doe", "surname2": "Smith", "surname3": "Dodson"}';
I need to get random value from both jsonName, jsonSurname (for example "John" and "Doe") and parse this two values into one object. I must to use Math.random. There can't be loops, arrays, Object.keys, Object.entries, Object.values, Object.getOwnPropertyNames.
I think that i must to use parse somehow for both properties:
JSON.parse(jsonName, function (key, value) {
// SOME MAGIC with Math.random
});
Help me please!
Aucun commentaire:
Enregistrer un commentaire