#alternative to spread array (...)
8 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
What specifically do you want to do? We need more context to be able to understand how to help. However, this sounds like more of a general js question and less of a kubejs question
I think destructing assignment is an acceptible alternative.
const aList = [1, 2, 3]
const [b, c, d, e] = aList
console.log(b, c, d, e)
example.js#29: 1.0
example.js#29: 2.0
example.js#29: 3.0
example.js#29: undefined
of course it's not as convenient as spread array as you'd need to know how many parameters the function take though
obj.fn.apply(obj, args)