JS functions that I learned this week

Today is friday and it’s the end of the week. Here are the top 5 javascript functions that I learned this week.

reduce() – Reduce function applied to arrays in Javascript. it takes the values in an array, from the first till the last element, and app…


This content originally appeared on DEV Community and was authored by DEV Community

Today is friday and it’s the end of the week. Here are the top 5 javascript functions that I learned this week.

  • reduce() - Reduce function applied to arrays in Javascript. it takes the values in an array, from the first till the last element, and applies functionality such that it changes the array into one singular value. Hence, it reduces the array.

  • for…of iterator - the for-of iterator is similar to for loop. The for...of statement loops/iterates through the collection, and provides you the ability to modify specific items.

  • Nullish Operator - If the left hand side value is null or undefined this operator returns the right-hand side value otherwise left hand side value.for example: const value= null ?? “Hello”;

  • Spread Operator - Spread operator helps to expand the array into individual elements. So, it can be used to expand the array in a place where zero or more elements are expected.

  • Object.entries() - The Object.entries() method returns an array of a given object's own enumerable string-keyed property [key, value] pairs. This is the same as iterating with a for...in loop, except that a for...in loop enumerates properties in the prototype chain as well.

Please share what you learned this week in the comments. :)

happyCoding #javascript #beginners


This content originally appeared on DEV Community and was authored by DEV Community


Print Share Comment Cite Upload Translate Updates
APA

DEV Community | Sciencx (2022-03-11T16:40:50+00:00) JS functions that I learned this week. Retrieved from https://www.scien.cx/2022/03/11/js-functions-that-i-learned-this-week/

MLA
" » JS functions that I learned this week." DEV Community | Sciencx - Friday March 11, 2022, https://www.scien.cx/2022/03/11/js-functions-that-i-learned-this-week/
HARVARD
DEV Community | Sciencx Friday March 11, 2022 » JS functions that I learned this week., viewed ,<https://www.scien.cx/2022/03/11/js-functions-that-i-learned-this-week/>
VANCOUVER
DEV Community | Sciencx - » JS functions that I learned this week. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/03/11/js-functions-that-i-learned-this-week/
CHICAGO
" » JS functions that I learned this week." DEV Community | Sciencx - Accessed . https://www.scien.cx/2022/03/11/js-functions-that-i-learned-this-week/
IEEE
" » JS functions that I learned this week." DEV Community | Sciencx [Online]. Available: https://www.scien.cx/2022/03/11/js-functions-that-i-learned-this-week/. [Accessed: ]
rf:citation
» JS functions that I learned this week | DEV Community | Sciencx | https://www.scien.cx/2022/03/11/js-functions-that-i-learned-this-week/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.