We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d24a8b commit aab275eCopy full SHA for aab275e
066-meal finder/script.js
@@ -7,7 +7,12 @@ const singleMealElement = document.getElementById("single-meal");
7
const searchHistory = document.getElementById("search-history");
8
9
let lastSearch = false;
10
-let searches = JSON.parse(localStorage.getItem("searches") || "[]");
+let searches;
11
+try {
12
+ searches = JSON.parse(localStorage.getItem("searches")) || [];
13
+} catch (e) {
14
+ searches = [];
15
+}
16
17
// Implement a Search History
18
function renderSearchHistory() {
0 commit comments