Assessment wanted for JSON skill test-1

Hi, I would like my work assessed.

link to the assessment:

link to my Codepen:

thanks in advance!!

Hi @ashwinsoni86 and sorry for the long waiting time :sweat_smile:

Nice work on this exercise! :clap:

Here are some comments:

  • Try to use consistent indention for better readability. Check out the differences when you hit “Format JavaScript” in CodePen.
    2022-05-15 17_36_15-JSON
  • I would prefer “dot notation” over “bracket notation” where possible:
    /* harder to read */
    /* easier to read */
  • Since we don’t need the index inside the inner loop, we could make it easier by using for..of:
    for (const kitten of catObj[i].kittens) { ... }
  • You used total++; in if and else. You could just put it outside the if...else condition once.

Feel free to ask questions if something is unclear. :slightly_smiling_face:

Happy coding,

Thanks @mikoMK for the feedback. I will definitely work on them.