Tagged Questions
2
votes
1answer
95 views
Object nested property access
I'm trying to write a function that adds an accessor for each nested property in an object. To make this a bit clearer, given object o, and a string representing a path, I should be able to access the ...
1
vote
3answers
67 views
Why is `this` losing its bind to my object?
I'm trying to make a recursive method but it is losing its binding to this. Here is the simplest way to recreate my issue:
var Foo = function() {
return {
foo : 'foo',
bar : ...
1
vote
5answers
3k views
Recursively Search in JSON or Javascript Object
For example:
[{
id:'our-purpose',
title:'Our Purpose',
slug:'/our-purpose',
backgroundImage:'images/bg-our-purpose.jpg',
showInNav:1
},
{
id:'our-people',
title:'Our ...
1
vote
2answers
110 views
Whats the best way to remove a property from nested javascript Object?
I have a tree object as below, I am trying to remove the items array property if it's empty. I am not sure on the best approach to do this?
I am thinking of looping through the key, check the ...
0
votes
2answers
302 views
How to remove null values from javascript object
I have a javascript object that contains two arrays. Sometimes one of the arrays may be empty. I'm trying to loop through the object via a recursive function but I don't want any arrays that are empty ...