How to get the path from javascript object from key and value

I have a javascript object width depth.

I need to know the exact path from this key within the object ex: “obj1.obj2.data1”

I already know the key is data1, the value is 123.

My javascript object look like this

{
    obj1: {
        obj2: {
            data1: 213,
            data2: "1231",
            obj3: {
                data: "milf"
            }
        }
    },
    obj4: {
        description: "toto"
    }
}

How could I achieve that ?

here is a jsfiddle : http://jsfiddle.net/3hvav8xf/8/
I am trying to implement getPath.

163 thoughts on “How to get the path from javascript object from key and value”

  1. Pingback: keto salmon
  2. I don’t know whether it’s just me or if perhaps everyone else encountering issues with your
    website. It appears as if some of the text on your
    content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them too?
    This may be a problem with my internet browser because I’ve
    had this happen before. Thanks

    Reply
  3. Its like you read my mind! You appear to know so much about this,
    like you wrote the book in it or something.
    I think that you could do with a few pics to drive the message home a bit,
    but other than that, this is magnificent blog. A great read.
    I’ll certainly be back.

    Reply
  4. Thanks for some other informative site. The place else
    may I get that kind of info written in such a perfect means?
    I’ve a undertaking that I’m simply now operating on, and I have
    been on the glance out for such information.

    Reply
  5. Oh my goodness! Impressive article dude! Many
    thanks, However I am having problems with your RSS.
    I don’t understand why I cannot join it. Is there anybody getting similar RSS problems?
    Anyone that knows the answer will you kindly respond? Thanx!!

    Reply
  6. Whats up very cool web site!! Man .. Excellent ..
    Superb .. I will bookmark your website and take the feeds additionally?
    I’m satisfied to find a lot of helpful information right here
    in the put up, we want develop extra strategies on this regard, thank
    you for sharing. . . . . .

    Reply
  7. Hi there, just became alert to your blog through Google, and
    found that it’s truly informative. I am going to watch out for brussels.
    I will be grateful if you continue this in future.

    Lots of people will be benefited from your writing.
    Cheers!

    Reply
  8. Good post. I learn something totally new and challenging on websites I stumbleupon every day.
    It will always be useful to read through articles from
    other writers and use something from other web sites.

    Reply
  9. I like the valuable information you supply to your articles.

    I’ll bookmark your weblog and test again right here frequently.
    I am reasonably certain I’ll be informed a lot of new stuff right here!
    Good luck for the next!

    Reply
  10. What’s Happening i’m new to this, I stumbled upon this I’ve discovered It
    positively helpful and it has helped me out loads.
    I’m hoping to contribute & assist different users like its helped me.

    Good job.

    Reply
  11. This design is wicked! You obviously know how to keep a reader entertained.
    Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Great job.

    I really loved what you had to say, and more than that, how you presented it.
    Too cool!

    Reply
  12. I will immediately snatch your rss as I can’t
    find your e-mail subscription hyperlink or e-newsletter service.
    Do you’ve any? Kindly let me recognize so that I could subscribe.
    Thanks.

    Reply
  13. hi!,I love your writing so a lot! share we communicate extra about your article on AOL?
    I require an expert on this house to unravel my problem.
    Maybe that’s you! Taking a look forward to look you.

    Reply
  14. I am curious to find out what blog platform you are utilizing?
    I’m having some small security problems with my latest blog and I
    would like to find something more secure. Do you have any recommendations?

    Reply
  15. Good post. I learn something new and challenging on sites I stumbleupon everyday.
    It will always be helpful to read through content from other authors and practice a little something from other websites.

    Reply
  16. We’re a bunch of volunteers and starting a brand new scheme in our
    community. Your site provided us with useful information to work
    on. You’ve performed an impressive process and our entire community might be grateful to you.

    Reply
  17. Good day I am so happy I found your web site, I
    really found you by error, while I was browsing on Aol for something else, Regardless I am here now and would
    just like to say thanks a lot for a remarkable post and a all
    round enjoyable blog (I also love the theme/design), I don’t have time to read
    it all at the moment but I have book-marked it and also included your RSS feeds, so when I have time I will
    be back to read a great deal more, Please do keep up
    the fantastic work.

    Reply
  18. 307905 788514Hey there! Someone in my Myspace group shared this website with us so I came to take a look. Im certainly enjoying the details. Im bookmarking and is going to be tweeting this to my followers! Exceptional blog and outstanding style and style. 853822

    Reply
  19. Hello! I could have sworn I’ve been to this website before but after
    checking through some of the post I realized it’s new to me.
    Anyways, I’m definitely happy I found it and I’ll be book-marking and checking back often!

    Reply
  20. Howdy very cool blog!! Guy .. Beautiful .. Amazing ..
    I will bookmark your site and take the feeds also? I am happy to seek out a lot of helpful information right here in the post, we want work
    out more strategies on this regard, thank you for sharing.

    . . . . .

    Reply
  21. We are a bunch of volunteers and starting a brand new scheme in our community.
    Your web site provided us with valuable information to work on.
    You’ve performed a formidable job and our whole neighborhood shall be grateful to you.

    Reply
  22. Please let me know if you’re looking for a article writer for your site.
    You have some really good posts and I think I would be a good
    asset. If you ever want to take some of the load off, I’d love to write some content for your blog in exchange for a
    link back to mine. Please blast me an email if interested.

    Thanks!

    Reply

Leave a Comment