<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Riku Kawano on Medium]]></title>
        <description><![CDATA[Stories by Riku Kawano on Medium]]></description>
        <link>https://medium.com/@rrrikukawano?source=rss-2e8401bf23a2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*MmhcUKUBl5QI7EXB.jpg</url>
            <title>Stories by Riku Kawano on Medium</title>
            <link>https://medium.com/@rrrikukawano?source=rss-2e8401bf23a2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 18:43:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rrrikukawano/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Closures]]></title>
            <link>https://medium.com/@rrrikukawano/closures-6cb0546597cf?source=rss-2e8401bf23a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cb0546597cf</guid>
            <dc:creator><![CDATA[Riku Kawano]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 04:55:17 GMT</pubDate>
            <atom:updated>2020-02-20T04:55:17.270Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is a <em>closure</em>?</strong></p><p>A closure is a function that remembers the variables of its outer environment. With closures, a nested function will have access to the variables and parameters of its parent function.</p><p><strong>Why is it important?</strong></p><p>Closures control the scope and accessibility of the variables in a function. This enables the use of more complex use of functions within a function and its variables and parameters.</p><p><strong>Real-world use cases</strong></p><p><strong>Here is an example</strong></p><pre>function sum(){</pre><pre>  let a = 1,</pre><pre>      b = 2</pre><pre>  return function() {</pre><pre>    return a + b;<br>  }<br>}</pre><pre>console.log(sum());</pre><p>The function “sum” returns a function that references the variables of the outer environment, which makes it a closure. The returned child function has access to the variables (“a” and “b”) of its parent function (“sum”).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cb0546597cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>