Thinking Recursively | Microsoft Interview Question | Software Engineer UI/Frontend

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024

Комментарии • 143

  • @akshaymarch7
    @akshaymarch7  5 лет назад +15

    Watch my full Microsoft Interview Experience here - ruclips.net/video/pjs1ZLjZhzk/видео.html
    I've discussed all the 4 rounds I faced in detail along with the questions asked in each round.

    • @kirthijain9891
      @kirthijain9891 3 года назад

      Akshay, did you get the output. Because I'm getting range error call stack size exceeded

    • @arpitanand5150
      @arpitanand5150 8 месяцев назад

      @@kirthijain9891 Base condition check kar aache se!

  • @TanmayKamath
    @TanmayKamath 5 лет назад +32

    I had a situation where i had to return a simple object by filtering through a nested object and build a treeview. Thinking recursively solved my problem :-).
    Great explanation Akshay )!

  • @sandeepsahoo4573
    @sandeepsahoo4573 Год назад +8

    I learn a lot from your videos. Thanks for making such contents.

    • @akshaymarch7
      @akshaymarch7  Год назад +1

      Thank you so much for supporting my channel, Sandeep. This means a lot. ❤️

  • @timepass336
    @timepass336 3 года назад +1

    when you explain, every step unfolds so clearly. If I try the same, hell breaks loose!

  • @abhijeetyadav1647
    @abhijeetyadav1647 5 лет назад +7

    Recursion! This was a much needed video. Thanks Akshay.

  • @mangeshgupta5677
    @mangeshgupta5677 4 года назад +2

    I had learned this recursion in my University syllabus, but they haven't explained how much it can bhi usefull in real application problems.
    Thank You Very Much 😊

  • @suryapratap9915
    @suryapratap9915 5 лет назад +7

    Thank you so much Akshay for making this video. I was able to recall this immediately when today I was solving an interview problem related to this but slightly modified. and finally i solved it. Thanks a lot. :D

  • @adeshgangwar3555
    @adeshgangwar3555 3 года назад +1

    Your video is increasing the thinking level when I see any JS problem. Thank you 😊

  • @kelseydavidson1173
    @kelseydavidson1173 2 года назад

    Thank you for specifically walking through how user would interact with the function. That was super helpful in solidifying my understanding of the code.

  • @VijayKumar-zx5bm
    @VijayKumar-zx5bm 5 лет назад +3

    Very informative and good explanation with suitable example . This is a common scenario in most of the front-end applications . Flattening the object improves the efficiency while searching by avoiding looping through the object multiple times . Will definitely try to apply this next time .

  • @testingtesting4984
    @testingtesting4984 9 месяцев назад

    Great task to practice recursion. Thanks for your work!

  • @BawalRider007
    @BawalRider007 4 года назад +3

    while watching your videos, I recall the days in Oracle while solving a similar kind of recursive problem to generate a tree structure in UI. Enjoyed every bits & pieces of the video. Great Video, KEEP IT UP.

  • @AdnanAli-cp9hk
    @AdnanAli-cp9hk 5 месяцев назад +1

    thankyou so much from the bottom of my heart for such a wonderful explanation, Sir.!

  • @Gauravguptakumar
    @Gauravguptakumar 4 года назад +1

    Super awesome.
    Recursion concept is haunting me from start of my career.
    You made it very easy.

  • @rumelabasuroy6586
    @rumelabasuroy6586 2 года назад

    Thanks Akshay ! I can't explain how much this video helped me in my works. Thank you for sharing this video. Its a great explanation!

  • @imranshaikh115
    @imranshaikh115 5 лет назад +4

    Marvellous explanation for Recursive approach. God may filled the joy in your life

    • @pleasesirmorevideos4684
      @pleasesirmorevideos4684 4 года назад

      God won't after listening to your english

    • @soultouchingsongs
      @soultouchingsongs 3 года назад +2

      @@pleasesirmorevideos4684
      God will surely listen. Language is not a barrier if blessings come from the heart. And Akshay has blessings of all as he is trying to help with all his efforts 🙏. Great explanations 👍 And just for info, this channel is purely for people with positive thinking.

  • @MohitKumar-nh1qb
    @MohitKumar-nh1qb 2 года назад +2

    Hello Akshay,
    Thanks for the solution. I faced this question while interviewing at Bloomberg. I did it in a very long way.
    The interviewer asked me to refactor my code and give a solution, but as you mentioned we should dry run our code, and then we should implement.
    My Solution:
    function isNonPrimitive(obj) {
    return ['[object Object]', '[object Array]'].includes(
    Object.prototype.toString.call(obj)
    )
    }
    function iterateObj(obj, str) {
    if (!isNonPrimitive(obj)) console.log(str + ' -> ' + obj)
    else if (Array.isArray(obj)) {
    obj.forEach((val, index) => {
    if (Object.prototype.toString.call(val) === '[object Object]') {
    for (let arr of Object.entries(val)) {
    if (!isNonPrimitive(arr[1])) {
    console.log(`${str}[${index}].${arr[0]} -> ${arr[1]}`)
    } else {
    if (str) {
    str = `${str}[${index}].${arr[0]}`
    } else {
    str = arr[0]
    }
    iterateObj(arr[1], str)
    let lastIndex = str.lastIndexOf('.' + arr[0])
    str = str.substring(0, lastIndex)
    }
    }
    } else {
    console.log(`${str}[${index}] -> ${val}`)
    }
    })
    } else {
    for (let arr of Object.entries(obj)) {
    if (str) {
    str = str + '.' + arr[0]
    } else {
    str = arr[0]
    }
    iterateObj(arr[1], str)
    let lastIndex = str.lastIndexOf('.' + arr[0])
    str = str.substring(0, lastIndex)
    }
    }
    }

  • @kanz831021
    @kanz831021 4 года назад +1

    Thank you so much for a crisp explanation! It helps a lot and gave me a idea of 'How to think Recursively' !

  • @vinothkumarv9722
    @vinothkumarv9722 3 года назад

    Vinoth love >> Akshay:
    30:23 better example taxanomy like you said electronic under refegerator, mobile, motor, fans,
    then refegerator under recurservelly, samsung, LG, BoSS, and some other list .
    super bro i clear... love you

  • @kartikkaushik4743
    @kartikkaushik4743 11 месяцев назад

    Thanks sir I am looking for this best vedio on RUclips

  • @adnancerttrain
    @adnancerttrain 3 года назад +2

    Hi sir Akshy Saini, Thank you so much keep it up. God bless you. ❤️

  • @VikasKumar-zw7ko
    @VikasKumar-zw7ko 3 года назад

    Thanks, this will solve a lot many problems. This will come handy when we will break the data that we are getting from API

  • @dheerajmantena6672
    @dheerajmantena6672 4 года назад

    You are amazing tutor Akshay, your video series is simply superb...!!! TYSM

  • @sandunmadushan1732
    @sandunmadushan1732 2 года назад

    You are the most awesome guy I ever seen. Thank you so much !

  • @amitnain8489
    @amitnain8489 4 года назад

    you are really great , best video of entire youtube

  • @rajkishan3690
    @rajkishan3690 2 года назад

    Great explanation ,akshay! 🔥

  • @fredbuilds9698
    @fredbuilds9698 2 года назад

    Great explanation Akshay! Really clear

  • @meenakshisundaram1002
    @meenakshisundaram1002 4 года назад

    It is a nice video to the explanation of Recursion and way to solve a problem using recursion. Thanks Akshay

  • @JavaScriptWithSohail
    @JavaScriptWithSohail 4 года назад +19

    Can you do the opposite? Take output of this program and retrieve back the question!
    Answer: jsbin.com/hudufif/edit?js,console

  • @soni.himansh
    @soni.himansh 2 года назад

    Beautiful Explaination.

  • @bighneshsamal6523
    @bighneshsamal6523 3 года назад

    Very good explanation for Recrusion.👍

  • @deeprajdey1364
    @deeprajdey1364 5 лет назад +1

    Superb Sir awesome video....😊

  • @RichaBhardwaj18
    @RichaBhardwaj18 Год назад

    Nice question!
    Thanks!

  • @abhisheksengupta4159
    @abhisheksengupta4159 4 года назад +1

    Great video, really allowed me to understand when to use recursions. I am from Java background but the code is very well explained... Keep up the good work

  • @knowledgefacts4602
    @knowledgefacts4602 3 года назад

    Thank you Akshay , Great video an recursion
    Helped me

  • @theakshaymohan
    @theakshaymohan 2 года назад

    Akshay bhaii! Itni mehnat! kyun 😢 ?? Thanks a lot for such a beautiful explantation! I was always kinda scared of recursion because I didn't know how it exactly worked or how to solve a problem on recursion! but this video gave me a boost in confidence that I can also solve problems on recursion! Always grateful to you ❤️

  • @akhila.sakhila9018
    @akhila.sakhila9018 4 года назад

    Thank you Akshay , I juet implemented in real time erp soln , this helped awesome and also thanks for sharing your uber use case as well :) Please keep sharing your experiences ♥️

  • @viraj268
    @viraj268 5 лет назад +2

    You will need to handle cases when object is null and an array. As typeof will return object for null and Array as well. For null it should go to else part and for an array i think you will have to append the index of object in array, depends on what your interviewer wants.

    • @akshaymarch7
      @akshaymarch7  5 лет назад

      Exactly, that's what I mentioned in the video also. We can improve this more to handle these corners cases. That's when you should always ask questions to your interviewer and clarify such cases.

    • @aviquid
      @aviquid 5 лет назад

      Yes, the null case has to be handled. However, the array case is handled here properly, where the index of the array will get appended to the key. There is no need of extra code in case of array.

    • @viraj268
      @viraj268 5 лет назад

      @@aviquid how the array would behave depends on the interviewers perception.

    • @viraj268
      @viraj268 5 лет назад

      Like here interviewer might not want to iterate over the array. Also he might say that iterate only over the objects own property and not its prototypes.

  • @momentswithmanisha
    @momentswithmanisha 4 года назад +1

    You are superb sir🙏

  • @apurvadhakre636
    @apurvadhakre636 3 года назад +1

    Hi Akshay!! It was a great video! Also.. are you from Dehradun? 😆

  • @anuraggupta4555
    @anuraggupta4555 2 года назад

    Thank you for sharing!!

  • @bhatvikrant
    @bhatvikrant 4 года назад

    Thanks akshay! it was a great video!

  • @anonymous........
    @anonymous........ 2 месяца назад +1

    Thanks

  • @rahulpurohit2461
    @rahulpurohit2461 5 лет назад +1

    You are so awesome man.

  • @syedmuhammadzaeemhasankazm7740
    @syedmuhammadzaeemhasankazm7740 4 года назад +1

    Thanks for great explanation. I learned something new and extremely amazing today. :)

  • @ajayrawat2168
    @ajayrawat2168 2 года назад

    Cute, how he explains and check everything is fine or not😅😀

  • @vishalsanserwal603
    @vishalsanserwal603 5 лет назад +1

    Nice! Keep up the good work😊✌️

  • @siyadeveloper
    @siyadeveloper 3 года назад +2

    Hi Akshay, Thanks again for your great tutorial!! Could you make a video on ReactJs or NodeJs if possible.

  • @karnot301
    @karnot301 4 года назад +1

    Hi your videos are great , authentic and it encourages everyone that you can become good at it 😊
    I have a problem of getting deep into the code and then get confused by the complexity of the functions like when you want to see how react , redux , jQuery works under the hood .
    Most confusion comes when I can't get the flow mostly with the function passing here and there .
    Can you share your experience with this ?
    Thanks for every video u have made ! I have almost watched all of them 🙏🙏

  • @deepak_life_in
    @deepak_life_in 3 года назад +6

    typeof(object) and typeof(array) would be "object" it self. How would we solve that edge case ?

    • @PushpakB541
      @PushpakB541 3 года назад +1

      Array.isArray(arr) would return true for an array.

    • @abhijitbhadoria743
      @abhijitbhadoria743 3 года назад

      I used this --> if (typeof obj[key] === 'object' && !(obj[key] instanceof Array))

    • @nshukla6
      @nshukla6 Год назад

      @@PushpakB541Array.isArray()

  • @shaikimran9641
    @shaikimran9641 Год назад

    the Vedios are very good......Sir is there any pdf or word format document to entire vedios.(like to remember explanation)...?

  • @vivekcool54
    @vivekcool54 5 лет назад +2

    Good to see u on utube bro..😉 all d best ..👍 #akshay #vivekgoyal

    • @akshaymarch7
      @akshaymarch7  5 лет назад

      Hi Vivek, Thanks a lot. It's great to see your text here. Ping me on WhatsApp, I lost your number. 😊👍

  • @naruto5437
    @naruto5437 5 лет назад +1

    great explanation....

  • @sourav_singh_diaries
    @sourav_singh_diaries 5 лет назад +1

    Great video Akshay. By the way I think using "for..in loop" is not good here because it traverses even the prototypes of object which we don't want here.

  • @simransrivastava4355
    @simransrivastava4355 3 года назад

    Thanks for this video and please make more such videos related to solving programming questions

  • @Raju-un8ir
    @Raju-un8ir 5 лет назад +1

    Nice one..also do one video for performance tuning in JavaScript..thnx

  • @rahulsonone6673
    @rahulsonone6673 4 года назад

    nice explanation Akshay... why don't you write the code on EDITOR after the explanation instead of board. This will solve the space problem.

  • @kashishjain78
    @kashishjain78 5 лет назад +1

    enjoyed a lot

  • @jaisamtani303
    @jaisamtani303 4 года назад +1

    A suggestion from my side would be while doing dry run, create recursive tree and write recursive calls alongside it. It will help alot in visualisation

  • @ManvendraMaan
    @ManvendraMaan 5 лет назад +2

    Thank you for that solution as it was really good to understand. But I have one question, if you have to avoid to declare that result object in global scope so that we won't pollute our global scope then what would you do? Just an improvisation with JavaScript in your solution.

    • @akshaymarch7
      @akshaymarch7  5 лет назад +4

      Pass it down as the third parameter to the magic function. I missed that part, but yeah check the link to code in description, I've done that there.

    • @ManvendraMaan
      @ManvendraMaan 5 лет назад

      Actually my point was regarding not to declare the result object outside of magic function. Think about a solution where you can declare it within the magic function so that it cannot be modified from outside the function. Hint : Using closure in JavaScript

    • @ManvendraMaan
      @ManvendraMaan 5 лет назад

      @Nitish Narang Thank you for your iterative approach which is nice. Eventually I solved it recursively also with concept of closure in JS. Thanks again to Akshay Saini for giving simple approach to the problem.
      //Solution
      let user ={
      name: "Akshay Saini",
      address: {
      personal: {
      city: "Dehradun",
      state: "Uttrakhand",
      area: "Majra",
      },
      office: {
      city: "Hyderabad",
      area: {
      landmark: "Hi Tech",
      }
      }
      }
      }
      let magic = () => {
      let finalObj= {}; // result object
      return function magicalFn(obj, parent)
      {
      for(let key in obj){
      if(typeof obj[key] === "object"){
      magicalFn(obj[key], parent + "_" + key);
      }
      else {
      finalObj[parent + "_" + key] = obj[key];
      }
      }

      return finalObj;
      }
      }
      let getCombinedKeys = magic();
      console.log(getCombinedKeys(user, "user"));

    • @kirthijain9891
      @kirthijain9891 3 года назад

      @@ManvendraMaan I'm getting Range error Call stack size exceeded

    • @johndoe-cq3de
      @johndoe-cq3de 3 года назад +1

      @@kirthijain9891
      let finalObj = {};
      const modifyObj = (obj, parentName = "user") => {
      for (let key in obj) {
      if (typeof obj[key] === "object") {
      modifyObj(obj[key], parentName + "_" + key);
      } else {
      finalObj[parentName + "_" + key] = obj[key];
      }
      }
      return finalObj;
      };
      console.log(modifyObj(user));
      Solution 2(if you don't want to use finalobj as global) :
      const modifyObj = () => {
      let finalObj = {};
      return (recursive = (obj, parentName = "user") => {
      for (let key in obj) {
      if (typeof obj[key] === "object") {
      recursive(obj[key], parentName + "_" + key);
      } else {
      finalObj[parentName + "_" + key] = obj[key];
      }
      }
      return finalObj;
      });
      };
      console.log(modifyObj()(user));

  • @AmarSingh-uw1db
    @AmarSingh-uw1db 5 лет назад

    Thank you so much for explaining this problem

  • @sushilkumartechy
    @sushilkumartechy 4 года назад

    great explanation !!

  • @nostacktofullstack
    @nostacktofullstack 4 года назад

    Great video, Please also come up with some DS and Algo videos.

  • @deeproy7292
    @deeproy7292 4 года назад +1

    I thought of using stacks for saving the intermediate object states

  • @tarungupta4854
    @tarungupta4854 3 года назад +1

    I was able to solve it :D
    the only difference is I used the spread operator in order to track the parent's key.
    const magic = (obj, ...keyNames) {}

  • @priyankaroy2827
    @priyankaroy2827 3 года назад

    Hello Akshay Sir, would you please discuss on GENERATOR Function and Async Await in details? Please?!

  • @rohitsachdeva4624
    @rohitsachdeva4624 3 года назад

    Hi akshay
    I have a stupidest doubt in recursion that how return works i.e when we do return how execution stack works. Can you prepare video on this.

  • @ranjandass13
    @ranjandass13 3 года назад

    Nice video but I had to watch it in 1.5x, :)

  • @sivaganesh4489
    @sivaganesh4489 4 года назад

    awesome ❤️

  • @Zaheer__zk40
    @Zaheer__zk40 6 месяцев назад

    A small change in
    Solution:
    const magicFn = (inputObj, parentName) => {
    let finalObj = {}
    for(let key in inputObj) {
    if(typeof inputObj[key] === 'object') {
    let nestedObj = magicFn(inputObj[key], parentName + '_' + key);
    finalObj = { ...finalObj, ...nestedObj };
    } else {
    finalObj[parentName + '_' + key] = inputObj[key];
    }
    }
    return finalObj;
    }
    const user = {
    name: 'Jon doe',
    address : {
    personal : {
    city: 'Any',
    pincode: '999999'
    }
    },
    profession: 'Software Developer'
    }
    console.log(magicFn(user, "user"))

  • @hussainratlamwala3628
    @hussainratlamwala3628 5 лет назад +1

    nice bro

  • @aarcheeecya
    @aarcheeecya 5 лет назад +4

    The way you teach from ground up, is really awesome. You should use RUclips promotion to lift your channel up, i am accessing this video from US, and every time i have to type your name to see your content, it just never show up in relevant videos at side. Amazing work !!!!

    • @akshaymarch7
      @akshaymarch7  5 лет назад +3

      Thank you so much for your kind words. I'm just trying to reach audience by organic reach and don't feel like spending money on marketing or ads. Will do that once I start generating revenue from here itself. I've some plans.
      But yes, if you like the videos then do share it with your network. It really motivates me to come up with more such content. Thanks a lot.

    • @aarcheeecya
      @aarcheeecya 5 лет назад

      @@akshaymarch7 That is really nice and great intention. Best wishes and i am a subscriber already. And yeah do catch some sleep.

  • @themynamesb
    @themynamesb 4 года назад +2

    thanks a lot for this knowledge.. It is very helpful !!

  • @karthikjoshi6386
    @karthikjoshi6386 3 года назад

    We can also use for of loop ?

  • @satyamkoduri3678
    @satyamkoduri3678 4 года назад

    What if there is an array value , because typeOf(array) is also a object right

  • @tanugoyal1
    @tanugoyal1 4 года назад +2

    Hi Akshay, First of all, thanks a lot for such informative videos that simplify the concepts, they really helped me in my job hunting.
    I had a request, actually, I was trying to access the nested objects in one of a machine test in a company, but I got stuck at a point, I was able to traverse through the object, but I had a situation wherein I need to print some value from the object, on the basis of some search criteria, like i had a nested object wherein suppose I got a match with some property, then I needed to go back to its parent to parent object and access some of its property and print it, I got stuck there, Can you please help me with this, how can I keep reference of previously accessed object, in a nested object. I am not sure, if you got my question.

  • @mathanprakash5685
    @mathanprakash5685 2 года назад

    Hi bro, I would like to request if you are free plz make the React js all concepts tutorial for your Juniors. Thanks

  • @manu8893
    @manu8893 3 года назад

    Hey Akshay I am thinking about those who dislike this video. They will punish by garun puran law.
    #CheersAkshay

  • @deeproy7292
    @deeproy7292 4 года назад

    thank you

  • @indrajeet9251
    @indrajeet9251 3 года назад

    What id I don't want to use global variable finalObj. I just want my function to return final destructed obj?

  • @XploreXperience
    @XploreXperience 3 года назад +5

    Hi Akshay, a question asked in Microsoft interview was around closure and everyone knows it by now, but a follow up question is around garbage collection of the closed variable. Could you have a session around it ?

    • @prashant7411
      @prashant7411 3 года назад +3

      JavaScript will trigger garbage collection once the variable goes out of scope. for reference type you can manually garbage collect by simple assign them as null this will garbage collect them but I suggest you better leave this to JavaScript engine it will take care of it.

  • @nishantkumar6960
    @nishantkumar6960 3 года назад

    Human generation is a recursive process. Father (A Human) --> Son (A Human) ---> Grandson (A Human) ---> ...

  • @tajstudentilhomjon757
    @tajstudentilhomjon757 10 месяцев назад

    I do not understand how the functions goes to office object after personal obj , could anyone explain what happens over there ?

  • @shubhamgaur3629
    @shubhamgaur3629 3 года назад

    As the result the outcome is not as we think sir during execution of the program sir could you do this on your vs- code Sir

  • @bikidas5473
    @bikidas5473 Год назад

    If(typeof(obj[key]) ! =object && ! Array. IsArray(obj[key]) this would be more guarded case

  • @SemicolonGuy
    @SemicolonGuy 3 года назад +1

    Solved it in 15 minutes only. : D

  • @ankitbaid11326
    @ankitbaid11326 5 лет назад

    your approach is good, Instead of storing data in Global you should handle it inside functional.
    JUST A SOLUTION. I REALLY LIKE YOUR APPROACH TOO.
    function getFinalObject(obj, parent) {
    const newObject = {};
    for (key in obj) {
    if (typeof obj[key] == 'object') {
    let nestedObj = getFinalObject(obj[key], key);
    for (nestedKey in nestedObj) {
    newObject[`${parent}_${nestedKey}`] = nestedObj[nestedKey];
    }
    } else {
    newObject[`${parent}_${key}`] = obj[key];
    }
    }
    return newObject;
    }

  • @ketansoni7777
    @ketansoni7777 3 года назад

    Bro tell me in case of array of objects

  • @mayankraghuvanshi486
    @mayankraghuvanshi486 5 лет назад

    Sir,
    I am a big fan of yours. I am trying to learn base web library implemented by uber but. sir I am really stuck. I can't even perform normal thing using this like form validation. sir can you help me just if you can give me some guidance, please.

    • @akshaymarch7
      @akshaymarch7  5 лет назад +1

      Hey Mayank, keep trying. It might be a little complex in the beginning but that's how you learn right?
      Keep trying, you'll be better. Read blogs or follow some tutorials, that would help you. Don't give up, all the best !

  • @SambhavJaintech
    @SambhavJaintech 3 года назад

    Got a max call size exceed if i used Object.entries. Didn't get why.

  • @akhilraghav3064
    @akhilraghav3064 4 года назад

    hI bro can you explain about event looping in javascript?

  • @mwshubham
    @mwshubham 4 года назад

    05:26 I thought you have two thumbs like Hrithik

  • @wmtit9650
    @wmtit9650 3 года назад

    30:00 How does final object second property know that it's grandparent was user and how does it know that it should put an underscore before?

    • @akhilraghav7677
      @akhilraghav7677 3 года назад

      @WMTIT As per your question, grandparent will be "user" because we are passing it in actual argument when function call and we are appending it in recursive call .
      It doesn't know about underscore we are appending it in recursive call and we are doing it because the output demands in that way ,It("underscore") could be optional and depends on interviewer ask.

  • @Nikhilkumar-yh7yc
    @Nikhilkumar-yh7yc 4 года назад

    Can we have a deep knowledge of JavaScript to learn Reactjs .

    • @Nikhilkumar-yh7yc
      @Nikhilkumar-yh7yc 3 года назад

      NO one replied on it.. now i having a deep knowledge in JS , and I am Good in react . No you don't need a deep knowledge to learn react. required Es6 features , concept of this.
      but guys first focus on JS . it will make u fall in love with it.. You will feel more comfortable in React .

  • @themynamesb
    @themynamesb 4 года назад

    Hi Akshay,
    I tried it. My logic went fine. But the issue is in my returned value.. Can you please tell why the value returned to me is a blank object {} instead of filled object..
    Code link: jsbin.com/sopaqoquyo/1/edit?html,js,console,output

  • @Varguitas10
    @Varguitas10 3 года назад

    Here for the thumbnail

  • @mohdshahrukh8212
    @mohdshahrukh8212 3 года назад +1

    29:50 how it will go there

  • @sureshsachdeva7447
    @sureshsachdeva7447 3 года назад

    Can anyone explain how
    1+[4] returns 14 I don't get this

  • @kirthijain9891
    @kirthijain9891 3 года назад

    I'm getting range error Maximum Call stack size exceeded

  • @nithinsastrytellapuri291
    @nithinsastrytellapuri291 4 года назад

    Hello Akshay,
    i tried to solve this problem on my own and I ended up using similar logic. Here's my solution link :
    codesandbox.io/s/recursion-x0i67?file=/src/index.js
    While I made the solution generic enough I have a few questions:
    As you can see from the result, I am printing only "key names" for top-level keys rather than "user_name" i am printing only "name". So how do I solve this? I don't want to hardcode the first object name as you did in the video. I want to make it generic but I couldn't understand how we can get the object name in JS. let's say I am traversing "obj" object, how do I print the name of it? Please reply if you know how to handle such a scenario.
    I also feel that there are too many if checks in the logic that I have written, any suggestions that can have? please comment. Thank you

    • @yadneshkhode3091
      @yadneshkhode3091 3 года назад

      i had same problem so i thought wrapping input in another object and use for in to get key name