Fixing jslint errors

I keep receiving jslint errors on this one.
https://jsfiddle.net/h3L26g75/4/

    function onStateChange(evt) {
        if (evt.data)

        {
            return;
        }

        if (!videoList.length)
            {videoList = videos.filter(function (a) {
                return a != player.getVideoData().video_id

This is wrong: );
This is wrong: }};)
This is wrong: );}

This seems to be yet another post on this video player project that you’ve been working on. Duplicate topics are not OK.

Counting the braces and parenthesis and closing them in the correct order is another basic JavaScript skill that you should learn. I highly recommend going back and doing some basic tutorials on JavaScript instead of wading deeper into this project with massive holes in your knowledge. Rushing makes projects take longer.

In this case, I count 3 unclosed {s and 1 unclosed (. You should close them in the reverse of the order that they were opened.

2 Likes

Fixed:

      if (!videoList.length) {
            videoList = videos.filter(function (a) {
                return a !== player.getVideoData().video_id;
            });
        }

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.