<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tolumide Shopein</title>
    <description>The latest articles on DEV Community by Tolumide Shopein (@tolumide).</description>
    <link>https://dev.to/tolumide</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F247240%2Fd4befa9c-a72e-4409-8e21-326f0bbcffff.jpeg</url>
      <title>DEV Community: Tolumide Shopein</title>
      <link>https://dev.to/tolumide</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tolumide"/>
    <language>en</language>
    <item>
      <title>Nullish Coalescing and Optional Chaining in Javascript </title>
      <dc:creator>Tolumide Shopein</dc:creator>
      <pubDate>Mon, 24 Feb 2020 19:39:27 +0000</pubDate>
      <link>https://dev.to/tolumide/nullish-coalescing-and-optionap-chaining-in-javascript-50j6</link>
      <guid>https://dev.to/tolumide/nullish-coalescing-and-optionap-chaining-in-javascript-50j6</guid>
      <description>&lt;h2&gt;
  
  
  Nullish coalescing (??):
&lt;/h2&gt;

&lt;p&gt;You might have encountered scenarios, where you needed to assign a default value to a variable(x) if the expression or variable from which the value of x is to be derived or deducted, is undefined or null but not when it is false, 0, or ''(empty string). &lt;br&gt;
This is almost impossible with the popular &lt;code&gt;||&lt;/code&gt; logical operator which you would have used to assign a different value if the boolean evaluation of the prior value (resulting from the expression or variable) is a falsy.&lt;/p&gt;

&lt;p&gt;This would be our reference object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const obj = {
  val: '100',
  test: 30,
  absent: 0,
  exam: 70,
  grades: {
    test: 23,
    exam: 49
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const removeScoreForAbsence = obj.absent || 0
console.log(removeScoreForAbsence) // 0

const inexistentValue = obj.valueThatDoesNotExist || 10
console.log(inexistentValue) // 10
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The problem with using the || logical operator as depicted above is that if we had wanted to assign the value of obj.absent to &lt;code&gt;removeScoreForAbsence&lt;/code&gt; regardless of its value unless it is &lt;code&gt;undefined&lt;/code&gt; or &lt;code&gt;null&lt;/code&gt;, then this would have been impossible since the boolean evaluation of an emptyString, false, and 0 result in falsy.&lt;/p&gt;

&lt;p&gt;Hence, nullish coalescing. So what does nullish coalescing bring to the table? Well, it assigns the value to the variable unless it is undefined or null&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const checkMe = obj.absent ?? 10
console.log(checkMe) // 0

const checkAgain = false ?? 20
console.log(checkAgain) // false

const checkNull = null ?? 25
console.log(checkNull) //25

const checkUndefined = obj.undefined ?? 35
console.log(checkUndefined) // 35
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Optional Chaining (?.)
&lt;/h2&gt;

&lt;p&gt;Let's assume you are a Frontend developer consuming a RESTful API with deeply nested results, where the absence of a key whose value is another object is very possible, you have probably had instances where you had to write an if/else block as dabble down the nested object, or use the &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt; (AND) logical operator in the process of assigning your value.&lt;/p&gt;

&lt;p&gt;Let's use a simple example here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const obj = {
  info: {
    type: 'human',
    firstName: {
      val: 'tolumide',
      firstLetter: 't'
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If we had wanted to get the value of the &lt;code&gt;firstLetter&lt;/code&gt; in obj above, what we would usually do would be to do a sort of type or value checking to confirm the existence of such nested keys in the object before accessing its values and then do a type check before we continue with its value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const letter = obj &amp;amp;&amp;amp; obj.info &amp;amp;&amp;amp; obj.info.firstName &amp;amp;&amp;amp; obj.info.firstName.firstLetter

console.log(letter) //t

if(letter){doWhatever()}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;With optional chaining however, we can write less code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const theLetter = obj?.info?.firstName?.firstLetter
console.log(theLetter) //t
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&amp;lt;&amp;gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const proveIt = obj?.info?.lastName?.firstLetter ?? 'no name'

console.log(proveIt) //no name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Good luck applying this 😃👍&lt;/p&gt;

&lt;p&gt;PS: I love feedback. If you have any please drop one below or reach out to me on.&lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;twitter =&amp;gt; &lt;a href="https://twitter.com/tolumide_ng"&gt;@tolumide_ng&lt;/a&gt;&lt;br&gt;
gitHub =&amp;gt; &lt;a href="https://github.com/tolumide-ng"&gt;@tolumide-ng&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>How to Invalidate JWT tokens on user logout with Redis</title>
      <dc:creator>Tolumide Shopein</dc:creator>
      <pubDate>Thu, 02 Jan 2020 17:07:53 +0000</pubDate>
      <link>https://dev.to/tolumide/how-to-invalidate-jwt-tokens-on-user-logout-with-redis-3ef8</link>
      <guid>https://dev.to/tolumide/how-to-invalidate-jwt-tokens-on-user-logout-with-redis-3ef8</guid>
      <description>&lt;p&gt;In this article, I will be sharing briefly how to invalidate JWT tokens on user logout (backend implementation) using Redis.&lt;/p&gt;

&lt;p&gt;Redis is an in-memory data structure store that can be used as a database, message-broker, or cache. I will be using the &lt;a href="https://redis.io/commands/zadd"&gt;sorted set&lt;/a&gt; data structure of Redis.&lt;/p&gt;

&lt;p&gt;Sorted sets in Redis allows you to save a member and its score in the Redis sorted set.&lt;br&gt;
Think of the sorted set as an object in javascript or dictionary in python, where the key is the score and the value is the member.&lt;/p&gt;

&lt;p&gt;For the sake of our goal, I will be assuming the score of each member (in this case the JWT token) of the sorted set as the expiry date or time of such JWT token.&lt;/p&gt;

&lt;p&gt;NB: This is not a full code implementation.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Issue Token&lt;/strong&gt; When the token is issued to the user on login/signup depending on your implementation. Save the token on Redis.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;i. Create a token that expires within 24hrs:&lt;br&gt;
  Something that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  //a. Ensure the user exist and the password is correct
  //b. Issue the token if (a) is okay

    const token = ({userId, email}) =&amp;gt; {
      return jwt.sign({
        data: {id, email}
      }, `${process.env.SECRET}` , { expiresIn: '24h' });
    }
    //c. Add the token to redis using the userId as the token key
    const tokenKey = new Date(Date.now() + (1000*60*60*24));
    await redis.zadd(`${userId}-tokens`, `${tokenKey}`, token);

    //d. Send the token to the user

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;ii. Check and remove invalid tokens on user login (you could use a cron &lt;br&gt;
      job for this instead):&lt;br&gt;
   Get expired tokens for this user on Redis and remove them&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const expiredTokens = await redis.zrangebyscore(`${user.id}-tokens`, 
      `-inf`, Date.now());

      // Remove expired tokens on user login/use a cronjob
     expiredTokens.length &amp;gt;= 1 &amp;amp;&amp;amp; expiredTokens.forEach(async token =&amp;gt; {
       await redis.zrem(`${user.id}-tokens`, token)
    });
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Remove specific token on user logout:&lt;/strong&gt;
So what I want is to not log out all devices the user might be connected with (you might do this if you have a feature to logout all devices feature), we want to logout the specific device that has this token, and ensures the token can never be used again even if it has not expired yet.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // Get the token sent from the frontend
    const {token} = args;
    const isTokenValid = await verifyToken(token)
    if(isTokenValid){
      const {userId} = isTokenValid.data
      const allTokens = await 
      redis.zrangebyscore(`${userId}-tokens`, `-inf`, 
        `+inf`);
         if (allTokens.includes(token)){
           await redis.zrem(`${validateToken.data.id}-tokens`, token);
           return Response({status: 'Success'})
         }
     }
    return Response({status: 'Failure'})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What this means: On every user request for content that might need authentication, you should ensure that such token is in the user's Redis store i.e &lt;code&gt;${userId}-tokens&lt;/code&gt;. If the token is not in the Redis store, then it is not a valid token anymore.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I do understand that this might not be a perfect implementation, I am therefore open to any constructive feedback.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Credits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://medium.com/devgorilla/how-to-log-out-when-using-jwt-a8c7823e8a6"&gt;How to logout when using jwt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quickleft.com/blog/how-to-create-and-expire-list-items-in-redis/"&gt;How to create and expire list-items in redis&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Can't Reset Gmail Password on a new device?</title>
      <dc:creator>Tolumide Shopein</dc:creator>
      <pubDate>Sun, 17 Nov 2019 08:42:06 +0000</pubDate>
      <link>https://dev.to/tolumide/can-t-reset-gmail-password-on-a-new-device-3f60</link>
      <guid>https://dev.to/tolumide/can-t-reset-gmail-password-on-a-new-device-3f60</guid>
      <description>&lt;p&gt;There is possibility that you have multiple email address, for different reasons, there is also possibility that your main devices through which you access all those accounts gets stolen, lost, bad or something else.&lt;br&gt;
Well, you might remember one of the passwords (perhaps the main account) so what happens to the other accounts?&lt;br&gt;
Well, this brief tutorial would help you access them since the new google security measures makes it almost impossible to use the forgot password option from a new device.&lt;br&gt;
Here are the steps I took which might help you.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Login to you main gmail account (The one that serves as the account recovery email for the other accounts)&lt;/li&gt;
&lt;li&gt;Click the Menu (Harmburger-like) option on the top-right-hand side of your screen and click &lt;code&gt;Account&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;On the new page rendered click the &lt;code&gt;security&lt;/code&gt; option that appears on the left hand side&lt;/li&gt;
&lt;li&gt;Scroll through your options on the new page and click &lt;code&gt;Password Manager&lt;/code&gt;in the &lt;code&gt;signing in to other accounts&lt;/code&gt; options&lt;/li&gt;
&lt;li&gt;On the new page, search for &lt;code&gt;google&lt;/code&gt; to find your associated google accounts&lt;/li&gt;
&lt;li&gt;Click on the result (you might have to sign in again with your current gmail password at this point for verification) and woooaaaahhhh, you have your gmail accounts with the passwords that you can use to login there.&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Javascript DataTypes: Array Methods with Practical Examples (forEach and map)</title>
      <dc:creator>Tolumide Shopein</dc:creator>
      <pubDate>Fri, 15 Nov 2019 06:29:58 +0000</pubDate>
      <link>https://dev.to/tolumide/javascript-datatypes-array-methods-with-practical-examples-foreach-and-map-1h2d</link>
      <guid>https://dev.to/tolumide/javascript-datatypes-array-methods-with-practical-examples-foreach-and-map-1h2d</guid>
      <description>&lt;p&gt;In this short tutorial, I would be introducing (for lack of a better word) you to the Javascript forEach and map methods of arrays.&lt;/p&gt;

&lt;h2&gt;
  
  
  forEach Method
&lt;/h2&gt;

&lt;h5&gt;
  
  
  Code 1.1.
&lt;/h5&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array.forEach(function(item, index, arr), thisArg)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The forEach method accepts two arguments, a callback function and a&lt;br&gt;
second argument that specifies the value of &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this"&gt;&lt;code&gt;this&lt;/code&gt;&lt;/a&gt; for each item in the array. If the thisArg value isn’t specified, then its value would be undefined.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, you would commonly find the forEach method of an array called only with the first argument (the callback function,thus assigning an undefined value to the second argument by default) as in 1.2 and 1.3 below and that is what I would explain:&lt;/p&gt;

&lt;h5&gt;
  
  
  Code 1.2.
&lt;/h5&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array.forEach((item, index, arr) =&amp;gt; {})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Or as:&lt;/p&gt;

&lt;h5&gt;
  
  
  Code 1.3
&lt;/h5&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array.forEach((item) =&amp;gt; {})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The forEach method allows you loop through each item of an array while performing a function on such item. I think it’s okay to call the forEach method an iterative array method and important to note that this method does not return any result.&lt;/p&gt;

&lt;p&gt;Basically, the forEach method accepts one argument (the callback function, used here as an arrow function) which accepts three arguments.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first argument is the current item in the array (during the
iteration) (required),&lt;/li&gt;
&lt;li&gt;The second argument refers to the position (index) of the current item in the array (optional),&lt;/li&gt;
&lt;li&gt;The third argument is the array itself (optional).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Basic Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const arr = 1, 2, 3, 4, 5, 6]
    arr.forEach((item, index, arr) =&amp;gt; {
    console.log(`${item} on index ${index} in ${arr}`)
});

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;NB: Most of the time you would only need and commonly see the array method implemented with the first argument (item) of the callback function.&lt;br&gt;
NB: Copy out all examples and try them out on your browser's console&lt;/p&gt;
&lt;h4&gt;
  
  
  Practical Example:
&lt;/h4&gt;

&lt;p&gt;Assume we are expecting data from an API(Application Programming Interface) which contains  the username, data and other details but not in the format we need to render it to our user. Perhaps we need to format some elements in such data first?, show only some of the data? or perhaps add extra information to such array before it is rendered to the user without editing the original array because you still need it for something elsewhere. Well, this is a beautiful situation where you might need the forEach method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const apiResponse = [{
  user: {firstname: 'tolumide', lastname: 'mic'},
  birthday: 'Sun Oct 15 2017 01:00:00 GMT+0100 (West Africa Standard Time)',
  phone: 070237461283
  },
  {
  user: {firstname: 'adeotun', lastname: 'ade'},
  birthday: 'Fri Mar 15 2013 01:00:00 GMT+0100 (West Africa Standard Time)',
  phone: 08111111111
}]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const modifiedResponse = [];
const assignValue = apiResponse.forEach(item =&amp;gt; {
  const newObj = {
    fullname: `${item.user.firstname} ${item.user.lastname}`,
  phone: item.phone
 }
  modifiedResponse.push(newObj)
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If we print the value of assignValue we would get undefined, however if we console the value of modifiedResponse we should get:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{fullname: 'tolumide mic', birthday: '10/15/2017', phone: 070237461283}, {...}]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;What did we do here?&lt;br&gt;
We can’t display an object containing first name and last name where we ought to display them together as full name or display display an unformatted date to the user. So what do we do? We loop through each content, making a new item containing the formatted information as we need to display it and then push it into a new array (modifiedResponse ) which we would use for display to the user.&lt;/p&gt;

&lt;p&gt;forEach method does not return a value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const names = ['tolumide', 'ibukunoluwa', 'adebowale', 'oluwaseyi']
const capNames = names.forEach(names =&amp;gt; {
  return name.toUpperCase();
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;capNames above would return undefined becase the &lt;code&gt;forEach&lt;/code&gt;method does not return a result.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;===&amp;gt; undefined
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Map Method
&lt;/h2&gt;

&lt;h5&gt;
  
  
  Code 2.1
&lt;/h5&gt;



&lt;p&gt;&lt;code&gt;array.map(function(item, index, arr), thisArg)&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The map method accepts two arguments, a callback function and a second parameter that would be used as to assign the value of &lt;code&gt;this&lt;/code&gt; for each invocation of the callback function(first argument). If the second parameter (i.e the value of this) is not provided, then its value would be &lt;code&gt;undefined&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Common representation: &lt;/p&gt;

&lt;h5&gt;
  
  
  Code 2.2
&lt;/h5&gt;



&lt;p&gt;&lt;code&gt;array.map((item, index, arr) =&amp;gt; {})&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h5&gt;
  
  
  Code 2.3
&lt;/h5&gt;



&lt;p&gt;&lt;code&gt;array.map((item) =&amp;gt; {})&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The map method like the forEach method loops through each item in the array. However, unlike the forEach method, the map method returns a new array containing the results of the function on each item of the original array.&lt;/p&gt;

&lt;p&gt;It does this by calling the callback function presented to it on each item in the array, and returning a result on completion. Like the &lt;code&gt;forEach method of arrays&lt;/code&gt;, the callback function in the map method accepts three arguments (item, index, and array).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Item: The current item in the array during iteration (required)&lt;/li&gt;
&lt;li&gt;Index: The position of the current element during iteration in the array (optional)&lt;/li&gt;
&lt;li&gt;Array: The array been transformed (optional)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Practical Example:&lt;br&gt;
Using the map method to create a new array where we capitalise the first letter of each item in the array.&lt;/p&gt;

&lt;p&gt;Loop through all elements in the array, running the assigned function and provide a new array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const apiResponse = [{
  user: {firstname: 'tolumide', lastname: 'mic'},
  birthday: 'Sun Oct 15 2017 01:00:00 GMT+0100 (West Africa Standard Time)',
  phone: 070237461283
  },
  {
  user: {firstname: 'adeotun', lastname: 'ade'},
  birthday: 'Fri Mar 15 2013 01:00:00 GMT+0100 (West Africa Standard Time)',
  phone: 08111111111
}]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const modifiedResponse = apiResponse.map(item =&amp;gt; ({
  fullname: `${item.user.firstname} ${item.user.lastname}`,
  lastname: item.phone
}))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You should get a response like this when you print the value of modifiedResponse with console.log()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[{fullname: 'tolumide mic', birthday: '10/15/2017', phone: 070237461283}, {...}]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;A good look at the example above shows that &lt;code&gt;map&lt;/code&gt;method returns a value which is assignable to a variable.&lt;/p&gt;

&lt;p&gt;Read More Here: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map"&gt;Array map method (MDN)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tc39.es/ecma262/#sec-array.prototype.map"&gt;ECMAScript 2020&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach"&gt;Array forEach method (MDN)&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
  </channel>
</rss>
