Typed Out String Leetcode Problems Javascript Function Call