What JavaScript environment is running the code? Judge doesn't accept many basic methods.


  • 0
    J

    The oldest JavaScript I could imagine, Node.js, is what I used to submit problems to the judge. However, this is proving challenging as even basic ES 5 Array methods are not currently defined. Most versions of V8, Node.js, io.js, FireFox, Chrome, Safari, IE, etc... all support these basic methods and they are critical really to solving algorithms efficiently in JavaScript.

    Some examples:
    Array.reduce, map, filter, etc...

    Bunch of 10 year old string functions.

    My only assumption is that the judge is using CScript or something to run the code which only supported ES 3.0 and doesn't ever and will never be updated.

    I'd really like to reach out to my community of JS developers and challenge them with a few of the LeetCode problems, but they'll run into the same issues I'm running into. I hope we can get this fixed so this becomes useful for JS programmers as well.


  • 0
    W

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.