<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What is the &amp;quot;context&amp;quot; parameter in reduce()</title><link>https://community.appian.com/discussions/f/new-to-appian/23638/what-is-the-context-parameter-in-reduce</link><description>Can someone explain with an example the reduce ( function, initial, list, context ) function&amp;#39;s &amp;quot;context &amp;quot; parameter. I didn&amp;#39;t find an example for it in the docs.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: What is the "context" parameter in reduce()</title><link>https://community.appian.com/thread/90666?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 06:44:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cacb0976-0254-4626-9952-749874942d03</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;The documentation has to say: &amp;quot;&lt;span&gt;Variable number of parameters passed directly into each function evaluation.&amp;quot; I think this is pretty clear.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the "context" parameter in reduce()</title><link>https://community.appian.com/thread/90660?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 05:48:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7e10b724-2e6b-4ee8-bc8a-809a175c9891</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;I tried implementing various cases of it below for my understanding.&amp;nbsp;&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1643953548954v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If we examine the pattern below, it looks like the context is being passed in every evaluation as an extra value along with the initial and respective item from the list.&amp;nbsp;&lt;br /&gt;Ex. In the expression on line 4, you can see that the result has been increased by 3. This means that the value in &amp;#39;context&amp;#39; was passed in the function along with the other 2 values, every time the reduce did an iteration. You can find a similar pattern in other expressions written in the above image.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>