Excuse me for not using any technical descriptions here as I am new to javascript. But this is a simple question for anyone learned in javascript.
I am just trying to create a new class that takes only one argument from an existing one that takes two or more arguments.
var newclass(arg) = oldclass(1,"hello",arg); // newclass is pre-filled with 1 and "hello"
Therefore I want to essentially pre-fill the arguments so I may only have to pass one argument in. What is the proper way of doing this in javascript?
JavaScript doesnt support default parameters. You can do something along the lines of:
or: