Need help translating Psychopy to JavaScript

Hello there,

I’m a complete beginner when it comes to programming and I’m currently stuck with this problem.
For the experiment I need a slider that looks like the rating scale (which doesn’t work on Pavlovia, hence the slider instead),meaning it should be a straight line that doesn’t show all the lines in between the beginning and the end.
I found a similar question and used the answer in the builder, which works fine:

for i, line in enumerate(slider.tickLines.sizes):
    if i not in [0,41]:  # Where 0 and 41 are your first and last tick locations
        slider.tickLines.sizes[i][1] = 0
slider.tickLines._needVertexUpdate = True

I’ve been trying to convert it to JS, since after the sync on Pavlovia it doesn’t show the changes made to the code, but since I’m a beginner in coding, I can’t get it worked.

Is there anyone who could maybe take a look at it?

For solution, see Slider Coding Questions.