Dependencies Used
- Lodash
- Sass
- Nodemon
Code Explanation
View the Siteconst _ = require('lodash');
This line imports the lodash library and stores it in a variable called _.
var $array01 = ['Rose', 'Tulip', 'Orchid', 'Hyacinth', 'Lily', 'Daffoldil', 'Poppy'];
var $array02 = ['Poppy', 'Sunflower', 'Hyacinth', 'Bellflower', 'Cactus'];
These lines make arrays and stores a bunch of strings in them.
console.log(_.intersection($array01,$array02));
This is a lodash method that compares two arrays and returns a new array containing only the items that appear in both.
Along with this script, the site was made using a Sass dependency that processed SCSS into CSS for me. Combining this with Nodemon allowed me to see updates to the site immediately.