Split() is not a function for javascript showing in browser

Why there is an error showing split() is not a function in this code?

function FindIntersection(strArr) {

// code goes here

var Fst= strArr.split(" ",5)

var Scd= strArr.split(" ",5)

if(Fst===Scd){

var trd= Fst;

strArr= Fst; 

}

return strArr;

}

// keep this function call here

console.log(FindIntersection(readline()));

split method works for string data types only while your FindIntersection function’s argument doesn’t seem like string. I suggest you check typeOf(strArr) of its String or not.