We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4272b5 commit e072e77Copy full SHA for e072e77
index.js
@@ -218,12 +218,24 @@ function userClicksOnEqualButton(button) {
218
// divideByZero(screen, result);
219
data = [];
220
data.push(result);
221
- historyEntries.forEach(entry => {
+ historyEntries.forEach((entry, index) => {
222
console.log(entry);
223
history.push(entry);
224
+ if(history.length > 3) {
225
+ history.pop()
226
+ }
227
console.log(history);
- historyElement.innerHTML += `<li>${entry.join(" ")}</li>`
228
+ historyElement.innerHTML += `<li> ${entry.join(" ")}</li>`
229
+ if(historyElement.childElementCount > 10) {
230
+ console.log("hi")
231
+ historyElement.firstElementChild.remove()
232
+
233
234
235
});
236
237
238
239
240
}
241
} catch (e) {
0 commit comments