Skip to content

Commit f5ccd42

Browse files
refactor(2020-day-01): remove sample code
1 parent 9f96cd3 commit f5ccd42

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

2020/day-01/expenseValidation.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,9 @@
99
const validateRecords = (records, checksum = 2020, goal = 2) => {
1010
const results = []
1111

12-
const obj = { foo: 'bar' }
1312
// Intentionally using `function()` instead of `() =>` because
1413
// the thisArg won't get passed to the find callback otherwise
1514
// https://stackoverflow.com/questions/46639131/javascript-array-prototype-find-second-argument-thisarg-not-working
16-
function testRecursive (record, idx, arr, parent) {
17-
console.log(`recurse check ${record} - `, parent)
18-
console.log(this)
19-
}
20-
records.find(testRecursive, obj)
21-
2215
function matcher (record) {
2316
this.depth = this.depth || 1 // depth tracking starts at level 1
2417
this.tracker = this.tracker || 0 // for basic sums, start counter at 0
@@ -53,6 +46,7 @@ const validateRecords = (records, checksum = 2020, goal = 2) => {
5346
return false
5447
}
5548

49+
// Parse the records to find results
5650
records.find(matcher, {
5751
maxDepth: goal,
5852
target: checksum

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy