There was a point in the JS curriculum I got left behind

Hey all, I’ve been off and on studying JavaScript for a year or so. I started learning here and everything was gravy until around RegEx. Then I started not understanding what I needed to do and soon had no chance of figuring things out without looking at the solution. From what I’ve read around, I’m not the only one who starts losing traction around that point.

The first time I realized I was lost, I decided to rebuild my foundation… I went through all of the MDN curriculum through JS and started up MIT60001 OCW.

I return to JS here periodically to make sure I don’t forget what little I know about syntax/semantics, but I still always have trouble with the challenges. I am in algorithms right now, and while I know what needs to happen conceptually, I simply can’t get the syntax and objects down in JS.

Any tips?

While I can comfortably code little projects in Python, JS still thoroughly stumps me. My next step is to just re-do every JS lesson here and grind it out until I understand, unless you JS folks have a secret trick you’re keeping from the rest of us.


What concepts are you having trouble with? Can you give some examples? RegEx doesn’t surprise me as it wasn’t really designed for readability. What else is stumping you? If you can be a bit more specific, I’m sure we can help you through it.

1 Like

Thank you for the helpful offer! It’s nothing in particular right now–nothing and everything anyway haha. If I recall correctly, it’s usually dot notation and arguments–arguments confuse the heck out of me!

This one with the arguments arr and elem, for instance:

function quickCheck(arr, elem) {
  if (arr.indexOf(elem) >= 0) {
    return true;
  return false;
console.log(quickCheck(["squash", "onions", "shallots"], "mushrooms"));

What lesson teaches you about what position 1 means within the parentheses, what position two stands for, how do I know what position n stands for?

The language just seems like such a jumble that it’s hard to keep things sorted. Dot notation seems like they just throw functions and crap all around it… myStr.slice.reduce.whatIsHappening.split(',').whyy;

Edit: Example code above is from

One helpful way of looking at dot notation: any time you see x.y it just means that y is inside x. Simple as that.

We know that objects are just collections of variables and functions (we usually call them properties and methods when they are inside an object). So what if we make an object with a bunch of functions in it. One of these functions has a variable in it. How do we refer to that variable from outside of the object? we write myObject.myFunction.myVariable. Now, our program knows that myVariable is inside myFunction, which is inside myObject. Does that make sense?

Now for arguments.
They are sort of like x or y in algebra. Say we want to define a function with some random argument. We will call it x here, but it doesn’t matter what you call it. So the function looks like this:

function myFunction(x) { return x + 3; }

Now, when you call myFunction, you can replace that x with whatever you want, anywhere that we put an x in our definition, it will be replaced with the number that you put. If we call
it will return 3 + 3,
if we call
it will return 35 + 3,
If we call
it will return myVariable + 3, as long as we define myVariable somewhere in our code.

1 Like

Dot notation is also used to chain things together in Javascript.
In your example:
we are first doing
next, we take the result of that (we will call it result1), and we do:
next, we take the result of the .reduce (we will call it result2), and we do:

And, in this manner, we keep applying each action in the chain to the result of the last action. This lets us daisy chain all of our operations together on one line, and ultimately saves us a lot of space.

I promise that once you get used to it, this syntax will be more readable than the alternative.

1 Like

do you mean in the argument list?
second lesson that introduces functions:
Basic JavaScript: Passing Values to Functions with Arguments

the first argument is assigned to the first parameter, second argument to second parameter, and so on

1 Like

Sorry for the delayed response. Fantastic explanation, thank you

1 Like

11/10 for converting my anxiety into a working lesson

Thank you. Good luck