• hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 hours ago

    No.

    By that same logic, memory safety issues in C/C++ don’t make them bad programming languages.

    If you’re worried about it, like you’re accepting input from the user, sanitize it.

    if (typeof userProvidedData !== "string") {
      throw new Error("Only works on strings.");
    }
    

    Better yet, put that in a function called assertString.