JS functions that I learned this week
Shiva Aryal

Shiva Aryal @connectaryal

About: Highly motivated and very passionate Full Stack Developer with more than four years of experience in Typescript, React js, Next js, Firebase, Tailwind CSS, Material UI, Node js, Express js, WordPress.

Location:
Kathmandu, Nepal
Joined:
Nov 1, 2020

JS functions that I learned this week

Publish Date: Mar 11 '22
22 7

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. Let's learn together :)
#happyCoding #javascript #beginners

Comments 7 total

  • CuriousDev
    CuriousDevMar 11, 2022

    What I have learned is, that in HTML you can use "dialog" element to create some kind of dialog window on the page, which can be opened and closed. Of course, there should be more, but this is what came to my mind.

    • Shiva Aryal
      Shiva AryalMar 11, 2022

      Awesome. Thank you for sharing. It was really helpful.

  • Diego  Fernando Mera Largo
    Diego Fernando Mera LargoMar 11, 2022

    hmmm the first thing that came in my mind is... you should be sure about when it is necessary to write comments in your code, and write the "why" of the code you are writing and not the "How it works". ^^

  • Faisal Amin
    Faisal AminMar 12, 2022

    Thanks bro , it would be much better if you add examples also

  • Faisal Amin
    Faisal AminMar 12, 2022

    Thank you! 😊

  • Andrew Baisden
    Andrew BaisdenMay 25, 2022

    Keep up the good work!

Add comment