I'm facing an issue where I need to extract the value of a specific key from a JSON object obtained after using JSON.stringify on form data. The current JSON object that I have looks like this:
{"KEY":"KM8IJM12D56U303366"}
Here's the code snippet I am using to retrieve and display this value:
const onSubmit = async data => {
// How can I specifically extract data from the stringified JSON
var jsonString = JSON.stringify(data, ["KEY"]);
alert(jsonString);
notify();
};
I attempted using getItem() but it seems to only be effective with local storage. Is there any alternative solution that would allow me to directly access the value of KEY post JSON.stringify()?