javascript apply on constructor, throwing “malformed formal parameter”
问题 thanks to wonderful responses to this question I understand how to call javascript functions with varargs. now I'm looking to use apply with a constructor I found some interesting information on this post. but my code is throwing errors attempt 1: var mid_parser = new Parser.apply(null, mid_patterns); error: TypeError: Function.prototype.apply called on incompatible [object Object] attempt 2: attempt 1: var mid_parser = new Parser.prototype.apply(null, mid_patterns); error: TypeError: