javascript - How to create a random JS object? -


i know if there way of creating javascript object randomized. understand randomized such: resulting object has random set of properties, every of has random name. problem boils down two:

1) possible have object created @ runtime, without earlier specifying amount of properties?

2) possible randomize names of object's properties?

i'm looking explanation/solution, not no/yes answer.

a crude way it, can't think of use case it:

function randomobject(){     var ret = {};     var propertycount= math.random() * 10;     (var x = 0; x < propertycount; x++ ){         ret[math.random()] = math.random();      }     return ret; } 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -