Error while using map function in javascript #4648
Unanswered
anvith09-png
asked this question in
Q&A
Replies: 1 comment
-
|
You're missing the return statement. With {}, it doesn't return automatically.
or
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use map on an array but getting undefined values.
Here is my code:
let arr = [1,2,3];
let result = arr.map((x) => { x * 2 });
Can someone explain what I am doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions