Answers for "how to take a random value from an object js"

0

how to take a random value from an object js

var randomProperty = function (obj) {
    var keys = Object.keys(obj);
    return obj[keys[ keys.length * Math.random() << 0]];
};
Posted by: Guest on February-05-2021

Code answers related to "how to take a random value from an object js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language