Basic algorithm scripting(javascript)

Hello, this post isnt a code specific. But i have an overall problem with this topic.
i restarted entire javascript session 3rd time now, to come and get stuck at this basic algorithm scripting section. I am insta stuck on the very first topic. Like, it asks to reverse a string, but as far as i can recall the previous topics do not walk you through the reverse join and etc functions. but in this case you have to use it, as i have searched the answers after the struggle. And this is the easiest, later scripting is harder and harder. i feel so mad at myself that i am stuck here for almost a month. i need some help or advice on what to do please.

Thank you in advance,
Temo

Your browser information:

Chrome

Challenge: Reverse a String

Link to the challenge:

1 Like

you can do it with a loop

but, yes, this section is hard.

make sure you understand the input and corresponding output, and then try to make the steps on pen and paper, without any JavaScript. Once you have the algorithm working there, only then you translate it to JavaScript.

It’s hard, it requires a lot of practice, a lot of grith and frustration. But you can do it. Also, use Read-Search-Ask as needed, but if you can, do not look for full working solutions, try to arrive there on your own.

2 Likes

i have been trying to overcome the algorithms for the past1.5 months, been doing coding mostly everyday for 4~ hours. but as soon as i come across algorithms, i just hit a brick wall. Also i feel like the fcc explanations are a bit dry in this regard.
How do you practice? maybe you have your way which you can share with me

1 Like

Hey @Temzarone!

Both of the algorithm sections require a whole other skill set of problem solving. It is ok to feel frustrated with these problems because you are brand new to this type of skill set and it takes time and practice. Eventually you will develop a process for problem solving and it will become easier. It did for me.

Here is my process for solving coding challenges.

  1. Step away from the computer and get some pen and paper. (This is an important step and should not be skipped)
  2. Paraphrase the problem in your own words to make sure that you understand it. (If the wording of the question is confusing then look at the FCC test cases and try to see if there is a pattern)

  1. Solve the problem away from the computer.
    Forget about code for a second and ask yourself
    How would I reverse a word?

Well you would naturally look at the last character of the original word and put that character in the beginning of a new reversed word right? Then you would repeat the process working from the end of the original word to the beginning and adding it one character at a time to the new word. Then you would stop when you have run out of characters.

4.Make sure to write out step by step how you solved the problem
This is important because you will use these steps to help you turn it into code.

Now that you have solved the problem away from a computer, then you can move back to your computer.

Go through each step of what you wrote out and look to mdn docs to help you along the way.

When I went through both algorithm sections, I relied heavily on mdn docs to look up array methods, string methods, as well as other things. Use that to your advantage.

Hope that helps!

6 Likes

Same here, BUT, its the way it meant to be. You must develop the habit of problem-solving skill. Do not try to get the answer just on FCC, search, read, think, code.
Cheers!

3 Likes

Thank you for finding time to give me advice on my current issue.
I feel like i can do that, because during learning i am used to using my notebook and a pan to write down everything i learn ( it helps me to remember things very well). Thus, writing down my thoughts and then transfering them into a code seems to be a great solution( and yes, my browser is full of MDN links right now haha) Thank you again and i will follow these steps from now on! Have a great day

1 Like

thak you, i will take into consideration all the advices you guys gave me. have a great day!

1 Like

Thank you for being honest. Your experience creating algorithms sounds painful. I woudn’t say you are insufficient, these problems are hard for your skill level and self-esteem in academics.
In ways that are not the wrong way to learn is using solutions. In my experience, I used provided answers for most problems in whole or part. I am frustrated by the lack of empathy towards people who use solutions frequently. As someone being introduced to coding using no other guidebook but freeCodeCamp, solutions have allowed me to pass problems. I evaluated myself as stupid for relying on answers, and while the evaluation was accurate, that thought did little to help. I decided to positively regard myself whether I am solving the “right” way or not.
Notes are writen in my CodePen pages of JavaScript units for my translation of other people’s code. Videos of challenges and extra ones are followed and recorded in repls with note comments. Preparing to learn the Sass unit, I am conducting my third pass of earlier JavaScript units, this time Basic Algorithm Scripting. I decided to take the “Try, but don’t let any one thing hold you up.” approach. Understanding synergy may take me longer than anyone I know. That is acceptable to me whom I want to be assured will be a back end programmer. Easier methods will come to me as I seek them out and trust in my ability as a living being.
In my struggle, I recall the down-on-herself character who achieves what she wants, Hinata in “Naruto.” “That’s my ninja way,” she says. People can have their own way, be it a foolhardy one. A person with incredible persistence and dedication can make such a plan work. I am often discouraged and re-encouraged by experiences that I believe shame my own and an applicable one that capture it.