svelte, javascript, json, fetch, user-input
index.tsx839 chars35 lines
To fetch the grades from JSON, we can make a GET request using the fetch API and then parse the JSON response. Here is an example of how to do this:
index.tsx134 chars5 linesFinally, to store the grades in JSON, we can create a JSON object and use the JSON.stringify method to convert it to a string. We can then store the string in local storage by calling the setItem method on the localStorage object. Here is an example of how to do this:
index.tsx187 chars8 linesThis will store the grades array in local storage under the key 'grades'. To retrieve the grades from local storage, we can use the getItem method like this:
index.tsx59 chars2 lines
gistlibby LogSnag