update snippets 78 - 96

This commit is contained in:
Stefan Feješ
2017-12-25 14:33:49 +01:00
committed by Agamemnon Zorbas
parent c829ed692e
commit 9ef34b7392
18 changed files with 90 additions and 43 deletions

View File

@ -6,6 +6,9 @@ Use `fs.writeFile()`, template literals and `JSON.stringify()` to write a `json`
```js
const fs = require('fs');
const JSONToFile = (obj, filename) => fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2));
// JSONToFile({test: "is passed"}, 'testJsonFile') -> writes the object to 'testJsonFile.json'
const JSONToFile = (obj, filename) => fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2))
```
```js
JSONToFile({test: "is passed"}, 'testJsonFile') // writes the object to 'testJsonFile.json'
```