0% found this document useful (0 votes)
0 views

Arrow function is way of writing ja

Arrow functions, introduced in ES6, provide a shorter syntax for writing JavaScript functions, enhancing code structure and readability. The map() method creates a new array by applying a function to each element of an existing array, while filter() applies a conditional statement to return elements that meet certain criteria. Reduce() condenses an array of values into a single value by applying a reducer function to each element.

Uploaded by

vidyaramesh9904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Arrow function is way of writing ja

Arrow functions, introduced in ES6, provide a shorter syntax for writing JavaScript functions, enhancing code structure and readability. The map() method creates a new array by applying a function to each element of an existing array, while filter() applies a conditional statement to return elements that meet certain criteria. Reduce() condenses an array of values into a single value by applying a reducer function to each element.

Uploaded by

vidyaramesh9904
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Arrow function is way of writing javascript function in shorter way.

Arrow function
introduced in ES6 Version.
they make our code more structured and readable. It is knowns as anynonyms
function(function without name and not bound by an
identifier) they do not return any value. and can be declared without any function
keyword. they are also called lamda function.

map(): Like a for loop

The method is used for creating a new array from an existing one, applying a
function to each one of the elements
of the first array.

Ex:

mobile.map(mob) => {<h1>{mob}</h1>}

filter(): Like a if else

*The filter method takes each element in a array and it applies a conditional
statement against it.
*IF THIS returns true the element gets pushed to the output array. It return false
doesn't pushed to the output array.

Ex: let students=[

{name:'ram' grade: 90};


{name:'ra' grade: 92};
{name:'ragu' grade: 94};
{name:'ramki' grade: 95};
]
students.filter((stud) => stu.grade >= 90);

Reduce():

The reduces an array of value down to just one value. to get the output value it
runs a reducer function on each element of
the array.

You might also like