Javascript – Should I use try catch to validate a value?
It does the job, but it feels ugly and repetitive. Any way to improve it? Also, is it considered good practice to use a try catch like this to check if a value is valid? function readJson(key, fallback) { localStorage.getItem(key)…