Navigation

    Cyberian
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Pro Blog
    • Users
    • Groups
    • Unsolved
    • Solved
    1. Home
    2. maria irshad
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Groups 0

    maria irshad

    @maria irshad

    0
    Reputation
    3
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    maria irshad Unfollow Follow

    Latest posts made by maria irshad

    • What is Reverse object hierarchy

      is there any way to reverse the object in js?

      const initObject = { 
        value: 5,
        next: {
         value: 10,
         next: {
           value: 15
           next: null
         }
        },
      }
      
      //expected result
      
      const newObject = {
        value: 15,
        next: {
          value: 10,
          next: {
            value: 5,
            next: null
          }
        }
      }
      
      

      need to a function, but struggling hard.
      I tried to find the object depth-first and then make a founded amount of iterations for … in … inside the object but don’t know how to rewrite the new one

      posted in Troubleshooting
      maria irshad
      maria irshad