'Unexpected token u in JSON at position 0 Error in JS

when i execute this

JSON.parse(ArrayBuffer);

I have this Error : SyntaxError: Unexpected token in JSON at position 0

Thanks for you response



Solution 1:[1]

Is your question why the error is occurring? This error occurs when we pass an "undefined" value to the JSON.parse method. ArrayBuffer is a binary data type. JSON.parse expects a JSON object to work properly.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dcmswim