Similar to C++ to JS (converting languages)