For this Question: Implement the function <code>numOfWords</code>, which should take a string
and return its result as an integer which is the number of space seperated words in it (Use JS In built functions)Function will take a string as argumentFunction will return the number of space separated wordsconsole. log(numOfWords("Hi World")) // prints 2

console. log(fnumOfWords("hi")) // prints 1

console. log(numOfWords("My name is Newton")) // prints 4, I have written this Solution Code: 
function numOfWords(line){
    // write code here
    // return the output , do not use console.log here
    return line.split(" ").length
}, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?