March 2018
Intermediate to advanced
592 pages
13h 44m
English
We need to import the isRealString function first before we can actually validate those two properties. We can make a const just below the generateMessage constant and use ES6 destructuring to grab isRealString, and we're going to grab it using require. We require a local file ./. It's in that utils directory and the file name is validation, just like this:
const {generateMessage, generateLocationMessage} = require('./utils/message');const {isRealString} = require('./utils/validation');
Now we can call isRealString inside join; that's exactly what we're going to do. We're going to check if either of them are not real strings. If one or more are not real strings, we're going to call the callback ...