There is a new operator in JavaScript for replacing the try...catch block. This operator is the ?= operator. You can assign two variables to it. Example use is below.
const demonstrationFunction = async () => {
const [error, response] ?= await fetch("www.example.com");
if (error) return console.error(error);
return response;
}
There is a new operator in JavaScript for replacing the try...catch block. This operator is the ?= operator. You can assign two variables to it. Example use is below.