I am studying javascript and i was wondering if there is any way of passing a function return to another function. for instance, let's say i have this function  title.toLowerCase().split(" ").join("-")  and i want to immediately pick it's return and pass to another function, like  (test) => console.log(test) .
What the second function will eventually do is to check if there is any - at the beginning of the string, and remove it case positive, i know there are other ways of doing this, but i want to know if is there a way with any function immediately after the return of the first function.
something like
title.toLowerCase().split(" ").join("-")}{(word) => {
                                            console.log(word);
                                            //checkIfContains-
                                            //remove-
                                            return newWord}};
 
    