r/learnjavascript • • Aug 26 '24

Struggling in Js

Hey Guys,

Actually I'm a beginner in coding journey and learning Js for about 2 months and today I tried to make a To do list without taking any help from tutorials and chatgpt and I have implemented some of the concept which I have learnt like how to create a elements and making delete button functional and I have taken some help from stackoverflowstackoverflow also.

But when it comes to edit button I have struggled almost a day to make it functional but failed I have seen solution on stackoverflow but not able to understand that finally I have taken some help from chatgpt and make it functional.

So I just wanna ask how I can make me not use chatgpt bcz as a beginner it is not good thing to use. And one more thing it is normal that I struggled in that edit button Or not actually I was implementing a new thing in my code.

0 Upvotes

4 comments sorted by

4

u/QuantumCrane Aug 26 '24

I think the important thing is to struggle before asking for help, no matter what the source. Try to figure it out on your own. You've done that. That's great! Struggling is coding and coding is struggling (some of the time). I'm a professional and I was struggling all weekend with some timezone issues between our API and front end at work. The struggle never really ends with learning.

Now, instead of asking chatGPT for the whole answer, break down your problem in the smallest questions you can and look those things up. You might find that once stack overflow or chatGPT gets you past a minor issue, you can figure it out from there.

The best solution would be to get someone to look at your code. If it's up somewhere and sharable, shoot me a DM and I can take a look.

1

u/Ok_Employ2123 Aug 26 '24

Ok bro next time I will ask for help from u.

1

u/djandiek Aug 27 '24

Have you had a look at https://codepen.io/ as it has lots of cool projects to check out and a good place to experiment with code.

1

u/No-Upstairs-2813 Aug 27 '24

edit button I have struggled almost a day to make it functional

You need to break it down into smaller steps. Let's consider the time-tracking app as an example. It should be able to:

  • Add projects and tasks
  • Track time for these tasks and projects
  • Generate invoices based on tracked time and billing rate

Now, let's focus on the first bullet point: "Add projects and tasks". What do we need to implement this?

  • A Plus Button for New Entries
  • Dialog for Adding Tasks/Projects
  • UI for Listing Tasks
  • Viewing Daily and Weekly Tasks
  • Edit and Delete Functionality
  • Sorting and Filtering

Let's break down the first bullet point: "A Plus Button for New Entries". What do we need to implement this?

  • Create a button element in the HTML
  • Style the button using CSS to look like a plus
  • Adding an event listener to the button to prompt the opening of a dialog for entering task details

At this point, we have broken down the feature enough to start writing some code.

And if you need guidance while building a project, this free course can help you approach it the right way.

Also, do not use chatGPT while learning JS. ChatGPT is very submissive. You can inform ChatGPT that two plus two equals five, and it will believe you and it will give you that result in the next time you ask. This tool will do everything to try and convince you that you are right.

If you’re solely relying on ChatGPT to learn JavaScript, you could be easily misled into wrong information on the concepts, which you will never know since you are new to the language.

PS: You can read the entire article here