Write a function called generateHashtag that takes a string as input and returns a hashtag-generated string according to the rules below. If the generated hashtag string is longer than 140 characters or the input/result is an empty string, the function should return false.
/**
* Generates a hashtag from the input string.
* @param {string} str - The input string.
* @returns {string|boolean} - The generated hashtag string or false.
*/
function generateHashtag(str: string): string | boolean;
generateHashtag("JavaScript is awesome"); // "#JavaScriptIsAwesome"
generateHashtag("hello world"); // "#HelloWorld"
generateHashtag("This is a very very very very very very very very very very very very very very long input that should result in a false hashtag because it exceeds the character limit of 140"); // false
generateHashtag(""); // false
false if the input string is empty or contains only whitespace characters.false if the generated hashtag string is longer than 140 characters.trim(), split(), and join() to work with the input string.charAt() to get the character at a specific index.false.split() method. The split() method accepts a regular expression as an argument. The regular expression /\\\\s+/ matches one or more whitespace characters.map() method to create a new array of capitalized words. The map() method accepts a callback function as an argument. The callback function is called for each element in the array. The callback function accepts the current element as an argument. The callback function returns the capitalized word.join() method. The join() method accepts a string as an argument. The string is used to join the elements of the array. In this case, we want to join the elements of the array without any characters between them.