Skip to content

Commit

Permalink
refactor: remove unused helper
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenrui committed Feb 9, 2024
1 parent e8943dc commit 245332e
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ const MiniJS = (() => {
_initializeGlobalVariables()
_addMethodsToVariables()
_applyBindings()
_addHelpers()
updateStates()
_listenToDOMChanges()
// Temporarily commented out - to be reviewed
Expand All @@ -106,16 +105,6 @@ const MiniJS = (() => {
console.log(`MiniJS took ${executionTime}ms to run.`)
}

function _addHelpers() {
// Add times method to numbers
// 5.times will return [undefined, undefined, undefined, undefined, undefined]
Object.defineProperty(Number.prototype, 'times', {
get: function () {
return Array.from({ length: this })
},
})
}

function _listenToDOMChanges() {
observeDOM(document.body, (mutation) => {
mutation.forEach((record) => {
Expand Down

0 comments on commit 245332e

Please sign in to comment.