Home / CSE / Javascript - CS :: Discussion

Discussion :: Javascript - CS

  1. What kind of an exception will be thrown if the string to parse is not valid JSON?

  2. A.

     SyntaxError

    B.

     ArrayOutOfBoundException

    C.

     Both SyntaxError and ArrayOutOfBoundException

    D.

     None of the mentioned

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    The method JSON.parse()throws a SyntaxError exception if the string to parse is not valid JSON.


Be The First To Comment