An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
April 25, 2021 10:06 pm GMT
Original Link: https://dev.to/rthefounding/writing-arrow-functions-with-parameters-573b
Writing Arrow Functions with Parameters
- Just like a regular function, you can pass arguments into an arrow function.
const double = (item) => item * 2;double(4);double(4) would return the value 8.
- It is possible to pass more than one argument into an arrow function.
const myConcat = (arr1, arr2) => arr1.concat(arr2);
console.log(myConcat([1, 2, 3,], [4, 5])); will display [1, 2, 3, 4, 5]
- Note:Java string concat() method concatenates multiple strings. This method appends the specified string at the end of the given string and returns the combined string. We can use concat() method to join more than one strings.
Original Link: https://dev.to/rthefounding/writing-arrow-functions-with-parameters-573b
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To