Adding methods to the Scala's companion object corresponds in JavaScript to adding functions to the constructor function