Arraybeginnerconst arr = new Array(1, 2, 3)
arr // β [1, 2, 3]Pass multiple arguments to new Array() to create an array pre-filled with those values.
When the Array constructor receives more than one argument, each argument becomes an element in the resulting array. This is equivalent to an array literal.
Challenge: Implement createArrayFromArgs that accepts any number of numbers and returns them as an array using new Array(...args).
createArrayFromArgs(1, 2, 3) // β [1, 2, 3]
createArrayFromArgs(42) // β [42]