How can you tell it isn’t working? I can’t even get it running.
I think there is a syntax problem with your code, but I would have a hard time diagnosing it because the formatting is so erratic. Formatting is your friend. Yes, it’s a pain until you get used to it and it becomes instinctual, but it will save you soooooooo much hassle in the long run. There have been sooooooo times when I have spotted problems just because the formatting is off.
CP even has a built in fomatter, in the pulldown menu each code pane - use it. But it won’t work until you fix the syntax errors - it can’t format code if it can’t tell what the structure is supposed to be. Also, in JS we don’t name variables in snake_case, use use camelCase traditionally, for most things.
Hi Kevin. I never knew there was a formatter thats great thanks, I’ve been spending a long time on that previously to make sure its all good.
I think the code needed an extra function, I took one out because I thought I could do it all in the same function but apparently not. Still has some issues though but I think its slightly closer
In addition to CP’s JS formater, I think you need to run the JS code analyzer as well. Yes, you have started to define a checks function but where exactly does it end?
Maybe the hints I’m giving you aren’t good enough, so I’ll try to be more direct. You start defining the checks function on line three. Notice that the letter ‘f’ in function is at column 0 on the line (i.e. right at the beginning of the line). You know that this function definition will be wrapped in curly braces. Since you formatted your JS nicely now, you know that the closing curly brace for this function should also be at the very beginning of a line. Scroll down until you reach the next function (checkedAll). Do you see a corresponding closing curly brace for the checks function at the beginning of a line before you reach the checkedAll function?