This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
3
i'm learning about rest parameters. someone kindly assist
Post Body
my problem is the 'element' in the arrow function. since theArgs is an array, you can't access its content with just a variable, i'm thinking you need a for...of loop to access each value in the array, how then does a single variable 'element' do that?
function multiply(multiplier, ...theArgs) {
return theArgs.map(element => { return multiplier * element }) }
let arr = multiply(2, 15, 25, 42)
console.log(arr) // [30, 50, 84]
Author
User Disabled
Account Strength
0%
Disabled 1 year ago
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
1,819
Link Karma
451
Comment Karma
1,268
Profile updated: 8 hours ago
Posts updated: 1 year ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnjavasc...