For this Question: Write a curried function called <code>reverseWords</code> that takes two string arguments. The first argument will be a sentence and the second argument will be a word. The function should append the word at the end of the sentence after leaving a space. The <code>reverseWords</code> function would return a function called <code>reverseFunc</code>.
 
The <code>reverseFunc</code> function, when called, should split the new sentence formed into individual words using <code>split()</code> function, reverse the order of the words using <code>reverse()</code> function, and join them back together with a space between each word using <code>join()</code> function. Then the new string formed should be returned by the <code>reverseFunc</code> functionThe <code>reverseWords</code> function takes two string arguments. The first argument will be a sentence consisting of multiple words and the second argument will be a single word.

The <code>reverseFunc</code> function takes no arguments. It used the new sentence formed by appending the second argument to the first argument of the  <code>reverseWords</code> function.The <code>reverseWords</code> function should return a function called <code>reverseFunc</code>.

The <code>reverseFunc</code> function should take the new string formed by appending the second argument to the first one of the  <code>reverseWords</code> function, split it into individual words, reverse their order, join them back with a space between each word, and return the string formed.const arg1 = "hello world";
const arg2 = "everyone";


const reverseFunc = reverseWords(arg1, arg2);
console.log(reverseFunc());    //prints "everyone world hello"
, I have written this Solution Code: function reverseWords(str, word){
  str = str + " " + word;
 
  function reverseFunc() {
    const words = str.split(' ');
    const reversedWords = words.reverse();
    const reversedString = reversedWords.join(' ');
    return reversedString;
  }
  
  return reverseFunc;
}
, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?