JSFiddle - React, Tailwind, and code Playground

by LyndseyB

JavaScript

const module = (dictionary = ['dog', 'cat', 'elephant', 'turtle', 'tiger']) => { 
	const numberOfWords = dictionary.length;
  
  return function() {
  	return numberOfWords;
  };
};

const dictionary = module(); 
console.log(dictionary());