part1.js 333 B

12345678910111213
  1. const fs = require('fs')
  2. let data = JSON.parse(fs.readFileSync('./Day 1/data.json'))
  3. data.forEach(element => {
  4. data.forEach(element2 => {
  5. if (element + element2 == 2020) {
  6. let answer = element * element2
  7. console.log(element + " " + element2)
  8. console.log(answer)
  9. }
  10. })
  11. });