January 2018
Beginner
658 pages
13h 10m
English
To use the _.isString utility, we'll add console.log in app.js to show the result to the screen and we'll use _.isString, passing in a couple of values. Let's pass in true first, then we can duplicate this line and we'll pass in a string such as Gary, as shown here:
console.log('Starting app.js');const fs = require('fs');const os = require('os');const _ = require('lodash');const notes = require('./notes.js');console.log(_.isString(true));console.log(_.isString('Gary'));// console.log('Result:', notes.add(9, -2));// var user = os.userInfo();//// fs.appendFile('greetings.txt', `Hello ${user.username}! You are ${notes.age}.`);
We can run our project over in the Terminal using the same command we've used previously, ...