Basic Algorithm Scripting - Parameters never been covered before, yet still expected to know them?

Tell us what’s happening:
Do I remember correctly by saying this was never covered in the previous challenges?
Previously I had to use .split and .reverse and .join, these were also never covered before but for some reason I am expected to know them, which kind of drags me down and really makes me worry if I ever manage to master Javascript since things are quickly becoming extremely difficult and parameters are added in which I’ve never seen before.

So far in basic algorithm scripting except for the first assignment I’ve been looking up the answer and copy pasting that one and trying to comprehend what is going on while I’d be much happier if I could just recognize what is needed to solve the challenge by myself, if that makes sense. Can anyone for example in this challenge like describe their line of thought on how they’d try solve the challenge? Perhaps it helps me in further challenges. I know about .length parameters, but if i remember correctly I’ve never even touched upon how we can JS automatically find the longest word in a string.

Also, I am having extreme difficulty understanding all of the hundreds of parameters that make up javascript and knowing when to use which. Does anyone know a good cheat sheet where I can directly know what to use in a certain situation or where to do small test assignments in between FCC challenges or how to better understand complex formulas? I am suffering from dyscalculia so some of these mathmetics formula’s are really giving me a hard time. Easy formulas and functions are good enough, but I do understand I have to eventually know how to learn advanced functions and formulas.

Your code so far

function findLongestWordLength(str) {
  return str.length;
}

findLongestWordLength("The quick brown fox jumped over the lazy dog");

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0

Challenge: Basic Algorithm Scripting - Find the Longest Word in a String

Link to the challenge:

Hi there,

A few things: it isn’t a good idea to look up answers. What will happen is what is happening to you now–you skip some basic knowledge and now are too far in and do not have the knowledge base to complete the assignments. It’s just going to get harder from here. You should really go back to the beginning and try again, reading every single challenge carefully and trying until you can complete it. If you DO have to look up the answer, you should read it over and over until you understand it and can implement it another way (not just copy/paste). You should need at most only a single line from the answer to complete the challenge.

Regarding the functions (.split, etc.)–you’re just going to have to learn them. You can do it over time. Not only does javascript have its own library, but you’ll need to learn even more from the libraries or packages that you download.

The good news is that you don’t have to memorize them! As long as you remember that they are there, you can google them to look up what they accept and what they return. I still do this all the time, even for some common ones.

To solve THIS particular challenge, you need to thing about the steps to execute the request.

  1. You have a string, with a bunch of words separated by spaces.
  2. You need to find the longest word in the bunch.
  3. Someone you have to count the length of each word.
  4. How can you separate the words to make counting them easier?
  5. Once you have counted them, how do I keep track of which word was the longest?
  6. Once I have identified the longest, how do I give back the answer?

Those are the six questions you need to answer to solve this one.

Good luck! Happy to help more if you have any other questions.

Jet because you see a solution with those doesn’t mean you need to use them.

Do not do this! Reading code is a completely different skill than writing code!!! Both are important, but reading code won’t teach you how to write code.

It doesn’t really work well that way. You need to try to develop your own line of thought and work through it. We can help with that.

Don’t worry amouth them. 98% of the time, you only need functions, variables, if, while, and for to solve a problem.

Hello everyone,
I’m having kind of the same issue described above:

When I entered this section, I was under the impression that I would be guided through the process of building the algorithms to solve the challenges (like in previous challenges) but in fact I am just given the problem expecting to solve it on my own.

This particular challenge I have no clue how to solve it and I have the question what is being expected from me at this point:

  • Look for the solution on FCC help section?
  • Google the way to solve it?
  • Break my head until I can come up with a solution?

I’ve seen some other of the headings following this challenge and I know for sure I will not be able to solve them.

This is the second time I go over the previous sections of this certification and I’ve performed better than the first time (except for the regular expressions section, that one still got me hahaha).

Any help, advise?

please create your own topic to discuss your concerns.

Ok. I thought it was not necessary.

You aren’t alone! The forum is here so you can ask questions and get help!

This stuff is hard, but the only way to learn how to problem solve is my actually trying to solve problems.