Leetcode Problems Two Sum Solution Javascript Function Declaration