aoc/2018/01/part1.js
2018-12-10 23:56:11 +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);