please write code for JavaScript class which satisfies the following specifications.…
- User
please write code for JavaScript class which satisfies the following specifications.
specifications:
- this code is executed in browser environment.
- this class is used to store data for frontend of web app like react or vue.js.
- this class is mainly used to store data to indexedDB, but fallback to use localStorage if indexedDB is not supported by browser.
- this class is like api wrapper for localStorage, so it has the same methods as localStorage api has.
- use idb library to handle with indexedDB.
- use async/await syntax rather than promise.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.