reset password
Author Message
nextmatrixman
Posts: 57
Posted 22:34 Oct 13, 2015 |

In the sample code of hw3 prompt 5:

node cli.js --trivia 35000 --save
facts.json
[
  {
    "text": "35000 is the number of genes in a human being.",
    "number": 35000,
    "found": true,
    "type": "trivia",
    "saved": "Fri Oct 09 2015 17:53:04 GMT-0700 (PDT)"
  },
  {
    "text": "1501 is the year that Michelangelo returns to his native Florence to begin work on the statue David.",
    "number": 1501,
    "found": true,
    "type": "year",
    "saved": "Sun Oct 11 2015 15:25:19 GMT-0700 (PDT)"
  }
]

It seems that the first object in the file is reflecting the result of the command on the top line. However, the time stamp of the first object is OLDER than that of the second.
So should we append the latest addition to the BEGINNING or the END?

Last edited by nextmatrixman at 22:36 Oct 13, 2015.
ngosrani
Posts: 31
Posted 12:54 Oct 14, 2015 |

You would have to append the latest addition at the end. 

Last edited by ngosrani at 16:13 Oct 15, 2015.