🔰error handling
// use second callback parameter to handle errors.
getJSON("/api/user/profile")
.then(doThisIfFulfilled, doThisIfRejected);
// use .catch() (more idiomatic way)
getJSON("/api/user/profile")
.then(displayUserProfile)
.catch(profileError);Last updated