aoc/2018/1/part1.js
2018-12-01 12:12:37 +00:00

12 lines
202 B
JavaScript

const fs = require('fs');
let input = fs.readFileSync('input.txt', 'utf-8');
let freq = 0;
input.split('\n').forEach(line => {
num = parseInt(line);
if (num){
freq += num;
}
})
console.log(freq);