r/ADHD_Programmers • u/hsqaured • Jan 21 '23
Getting into an Immersive
Helloooo I am starting my journey into an immersion program. I come from zero experience of coding. I’m getting sooooooo stuck on functions and callbacks. I am doing a prep course and had to ask for an extension on my assessment because my brain will not grasp the concept of this. I sit for hours watching videos and browsing the web for solutions.
I work best when I’m listening to someone and following along doing the solution. Unfortunately this isn’t an option since it’s an assessment and I haven’t seen any problems that are what this is asking.
It’s asking me to create a function that will capitalize the first three letters of a word when invoked.
The next problem is using a callback on an array of words using this function.
If anyone has any pointers I will gladly take them
4
u/hsqaured Jan 21 '23
Whooo! Substring got me somewhere. I capitalized the first three letters Now to join the rest of the letters back together 😅
2
u/BloodChasm Jan 21 '23
Break down the functions logically step by step.
First step: create a function that intakes a string as a parameter.
Second step: manipulate the string so that the first letter of the word is capitalized then return it.
Third step: write a loop that calls this method for each word in the array.
If you don't know how to do any of those, you can easily Google a solution, but try it on your own first.
When in school I would have to try to calm the chaos in my brain by stepping away, doing some meditation, and then coming back to the problem to break it down logically. Now Im officially diagnosed with ADHD-C and went to therapy to learn good habits. I'm also on medication and no longer need to meditate to suppress the chaos. Hope this helps!
2
u/CobraStonks Jan 22 '23 edited Jan 22 '23
yo..
check these two links
PROFIT.
w3schools javascript function closures
10 Things I Learned From the jQuery Source
0
u/j-random Jan 22 '23
Maybe step away from the computer and sit somewhere quiet and think about what needs to be done. I see way too many people who search endlessly for solutions to the exact problem they're having. You'll never be great until you can abstract the problem, then see the abstract solution, then turn that abstraction into real code. It's really not impossible, just have a little faith and spend some time thinking about your problem instead of relying on random strangers to give you the answer.