JSFiddle - React, Tailwind, and code Playground
by smacky311
JavaScript
var someObject = {
"158":"Banana",
"265":"Pear",
"358":"Apple",
"864":"Peach"
};
console.log(someObject.reverseObject());
Object.prototype["reverseObject"] = function(o) {
var name;
var newObject;
for(name in o) {
if(typeof this[name] !== 'function') {
newObject[this[name]] = value;
}
}
return newObject;
}
var i;
var properties = [
for(i = 0; i < properties.length; i += 1) {
}
//result
{
"358":"Apple",
"158":"Banana",
"864":"Peach"
"265":"Pear",
}