I am working on an angular2 project. I am stuck with these errors. The error occured when I tried to send the JSON objects to the backend. It may be due the parsing of JSON obje
Normally it happens when you use arrow function for fetching data through API and in that you use 'this' keyword. So, arrow function not have its own 'this' So, we got error. This is not the main reason but it is one of them.
fetch.addEventListener('load',()=> {
const [delta] = JSON.parse(this.responseText);
console.log(delta);
//Uncaught SyntaxError: Unexpected token U in JSON at position 0 at JSON.parse ()