Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Constructor () {
- // do something with variable args.
- for (var i in arguments) {
- this[i] = arguments[i]
- }
- }
- function factory () {
- var n = Object.create(Constructor.prototype)
- , o = Constructor.apply(n, arguments)
- return (typeof o === "object" && o) || n
- }
- var f = factory(1, 2, 3, 4, 5)
Add Comment
Please, Sign In to add comment