I know that I can use map with a function of one variable in the following manner:
var squarefunc = function(x) {
return x*x;
};
values = [1,2,3,4]
values.map(squarefunc) // returns [1,4,9,16]
How do I use map with the following function:
var squarefuncwithadjustment = function(x, adjustment) {
return (x*x + adjustment);
}
where, I want to input value for argument adjustment manually when I call map, say adjustment=2, and have the value of x taken from the array values.