Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js object random key

var randomProperty = function (obj) {
    var keys = Object.keys(obj);
    return obj[keys[ keys.length * Math.random() << 0]];
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #object #random #key
ADD COMMENT
Topic
Name
7+4 =