<?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: samairali</title>
    <description>The latest articles on DEV Community by samairali (@samairali).</description>
    <link>https://dev.to/samairali</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%2F206784%2F86bb38ea-d06c-46e8-a222-7dfd15aa1f0e.jpeg</url>
      <title>DEV Community: samairali</title>
      <link>https://dev.to/samairali</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/samairali"/>
    <language>en</language>
    <item>
      <title>Two type of functions and there difference</title>
      <dc:creator>samairali</dc:creator>
      <pubDate>Sun, 04 Aug 2019 17:45:34 +0000</pubDate>
      <link>https://dev.to/samairali/two-type-of-functions-and-there-difference-h0g</link>
      <guid>https://dev.to/samairali/two-type-of-functions-and-there-difference-h0g</guid>
      <description>&lt;p&gt;I have one scenario where i am submiting the form data and alert the data , i am working on react js so the thing is on submit the code is &lt;br&gt;
onSubmit={ this.handlesubmit }&lt;br&gt;
and here comes the issue which i dont understand &lt;br&gt;
when i declare function like this&lt;/p&gt;

&lt;p&gt;handlesubmit(e){&lt;br&gt;
        e.preventDefault()&lt;br&gt;
        alert( &lt;code&gt;${this.state.inpUname} ${this.state.inpComment} ${this.state.profession}&lt;/code&gt; )&lt;br&gt;
    }&lt;/p&gt;

&lt;p&gt;it gives error , but when i declare function like that everything is ok&lt;/p&gt;

&lt;p&gt;handlesubmit = (e) =&amp;gt; {&lt;br&gt;
        e.preventDefault()&lt;br&gt;
        alert( &lt;code&gt;${this.state.inpUname} ${this.state.inpComment} ${this.state.profession}&lt;/code&gt; )&lt;br&gt;
    }&lt;/p&gt;

&lt;p&gt;i want to know the difference&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
