Answers for "js object random key"

0

js object random key

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 "Javascript"

Browse Popular Code Answers by Language