# Same result different code

**URL:** <https://forum.codewithmosh.com/t/same-result-different-code/24806>\
**Category:** JavaScript\
**Created:** [January 28, 2024, 11:52am UTC](https://forum.codewithmosh.com/t/same-result-different-code/24806 "2024-01-28T11:52:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HolyMischu](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@HolyMischu](https://forum.codewithmosh.com/u/HolyMischu)\
**Post date:** [January 28, 2024, 11:52am UTC](https://forum.codewithmosh.com/t/same-result-different-code/24806/1 "2024-01-28T11:52:06Z")

</div>

Hi there,  
I’m new to coding and these tutorials are helpful.

But when I solved the exercise in the 4th chapter, 13th video (4th ex.) I got in my eyes a very different code for the same work.  
I mean, maybe I did something that doesn’t make sense… but it still works.

How can I take the most out of it, also going forward?

![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/d/d609697e3306b08e6f344098d26536c1fc5f7c05.png)

---

<div class="post-metadata">

**Author:** ![UniqueNospaceShort](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/uniquenospaceshort/32/1814_2.png) [@UniqueNospaceShort](https://forum.codewithmosh.com/u/UniqueNospaceShort)\
**Post date:** [February 3, 2024, 9:39pm UTC](https://forum.codewithmosh.com/t/same-result-different-code/24806/2 "2024-02-03T21:39:47Z")

</div>

Hi,

If it works that’s fine. Especially from a learning person.  
Moreover every code has a personal style. I see it in the team i belong to.

When things get a bit more serious you may start worrying about other concerns.  
Myself, I am still far away from what I mean.  
Some people are into comparing different methods of doing the same thing to be more efficient in term of resources, time, a code takes.

Being curious is good, but over-worrying about it is not.

Take your time with such concerns. They will come to you sooner or later.

Cheers.

P.S. : To answer your question you shall do the exercises the most possible on your own. After a while if you struggle you can seek any help.  
When you have a working solution, you can compare. I can tell you that on the internet you may have solutions that are not so good that you may think, even on a platform such as stack overflow or even here.  
People are trying to help but they do not really know.  
I remember having a validation problem with ASP .NET and asked on SO. The answer I got was to disable validation which is a but no no to me. This helps the database ensure the integrity of my model when doing what I was told was basically making the DB weak.  
I actually found my own solution afterwards. Maybe far from perfect but nothing is. You have to make technical choices all the time.

---

<div class="post-metadata">

**Author:** ![HolyMischu](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@HolyMischu](https://forum.codewithmosh.com/u/HolyMischu)\
**Post date:** [February 4, 2024, 7:04pm UTC](https://forum.codewithmosh.com/t/same-result-different-code/24806/3 "2024-02-04T19:04:54Z")

</div>

Thank you very mutch.  
I think I get what you’re saying, so I’ll try to keep that in mind.

With kind regards
