File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const operators = document.querySelectorAll("[data-operator]");
99const operatorRegex = / [ \/ * \- + ] / ;
1010const ZERO = 0 ;
1111const ZERO_DOT = '0.' ;
12+ const HISTORY_LIMIT = 10 ;
1213const history = [ ] ;
1314
1415console . log ( slidingPart )
@@ -265,13 +266,10 @@ function displayResult(array, outcome) {
265266
266267function createHistoryList ( array , element , history ) {
267268 array . forEach ( ( entry , index ) => {
268-
269269 history . push ( entry ) ;
270-
271270 element . innerHTML += `<li> ${ entry . join ( " " ) } </li>`
272- if ( element . childElementCount > 10 ) {
273- console . log ( "hi" )
274- element . firstElementChild . remove ( )
271+ if ( element . childElementCount > HISTORY_LIMIT ) {
272+ element . firstElementChild . remove ( ) ;
275273 }
276274 } ) ;
277275}
You can’t perform that action at this time.
0 commit comments