Skip to content

Instantly share code, notes, and snippets.

View homeslicesolutions-zz's full-sized avatar
🤠
It’s happening

Joe Vu homeslicesolutions-zz

🤠
It’s happening
View GitHub Profile
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;