<?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: Sham Gurav</title>
    <description>The latest articles on DEV Community by Sham Gurav (@shamgurav96).</description>
    <link>https://dev.to/shamgurav96</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%2F829640%2F839067ec-6b99-422a-bc45-007ee76ff55f.png</url>
      <title>DEV Community: Sham Gurav</title>
      <link>https://dev.to/shamgurav96</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shamgurav96"/>
    <language>en</language>
    <item>
      <title>Should I start learning React or is it too late ???</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Sat, 23 Apr 2022 16:51:55 +0000</pubDate>
      <link>https://dev.to/shamgurav96/should-i-start-learning-react-or-is-it-too-late--3ic8</link>
      <guid>https://dev.to/shamgurav96/should-i-start-learning-react-or-is-it-too-late--3ic8</guid>
      <description></description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to disable right click on web page ???</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Wed, 20 Apr 2022 17:06:49 +0000</pubDate>
      <link>https://dev.to/shamgurav96/how-to-disable-right-click-on-web-page--6da</link>
      <guid>https://dev.to/shamgurav96/how-to-disable-right-click-on-web-page--6da</guid>
      <description>&lt;p&gt;It is not recommended to disable the Right-Click on any web page. Anyone with basic understanding of browsers can view the source and extract the information they need.&lt;/p&gt;

&lt;p&gt;No matter what we do, We cannot prevent users from having full access to the page content. oncontextmenu event can be disabled by disabling the Javascript on the webpage. But it's good to know a way to disable the right-click on page if you ever needed.&lt;/p&gt;

&lt;p&gt;You can disable Right-Click on web page using &lt;code&gt;contextmenu&lt;/code&gt; HTML Event. The &lt;code&gt;contextmenu&lt;/code&gt; event occurs when the user right-clicks on an element to open the context menu.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body oncontextmenu="return false"&amp;gt;
   &amp;lt;div&amp;gt;...&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE :- If you want users to stop copying page content then use &lt;code&gt;oncontextmenu&lt;/code&gt; along with CSS directive &lt;code&gt;user-select: none&lt;/code&gt; .&lt;/p&gt;

&lt;p&gt;&lt;code&gt;user-select: none&lt;/code&gt; will disable any selection on web page. User won't be able to select the any text or image after that.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Shorten The Console.log</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Tue, 12 Apr 2022 15:04:19 +0000</pubDate>
      <link>https://dev.to/shamgurav96/shorten-the-consolelog-25h8</link>
      <guid>https://dev.to/shamgurav96/shorten-the-consolelog-25h8</guid>
      <description>&lt;p&gt;Tired of writing console.log() again and again ??? the the following JS tip is for you .&lt;/p&gt;

&lt;p&gt;You can shorten the log() function with the help of Function.prototype.bind . &lt;/p&gt;

&lt;p&gt;Since ES5, all functions have a bind method that allows one to create a new function specifying the context.&lt;/p&gt;

&lt;p&gt;Use bind method to pre-define the context execution to always point to console. This way, no matter how the function is invoked, we are instructing the JavaScript engine to always set the context execution to console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const C = console.log.bind(console);

C("Downloaded Successfully !!!");
// Downloaded Successfully !!!

C("Code Executed Successfully !!!");
// Code Executed Successfully !!!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>#27 Guess The Output ???</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Mon, 11 Apr 2022 17:54:17 +0000</pubDate>
      <link>https://dev.to/shamgurav96/27-guess-the-output--hml</link>
      <guid>https://dev.to/shamgurav96/27-guess-the-output--hml</guid>
      <description>&lt;p&gt;⭐ Reply with correct answer &amp;amp; Bonus points for explanation ⚡&lt;/p&gt;

&lt;p&gt;💡 Correct answer with detailed explanation will be updated in comments after 48 hours.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EcGCuYaW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lo20ediv0wpxek6p9mbm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EcGCuYaW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lo20ediv0wpxek6p9mbm.png" alt="#27 Guess The Output???" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log((055-35)-5);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to change caret color using CSS ???</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Mon, 11 Apr 2022 17:47:35 +0000</pubDate>
      <link>https://dev.to/shamgurav96/how-to-change-caret-color-using-css--4la6</link>
      <guid>https://dev.to/shamgurav96/how-to-change-caret-color-using-css--4la6</guid>
      <description>&lt;p&gt;You might be wondering what is caret and why I need to change the color of caret ???&lt;/p&gt;

&lt;p&gt;caret is blinking cursor in any text input field , visible marker where the next character typed will be inserted. This is sometimes referred to as the text input cursor. By default, it is black, but its color can be altered with this property.&lt;/p&gt;

&lt;p&gt;Sometimes you want to change the color of caret to match the theme of website or make it visible and noticeable in dark themes of websites. At these times You can change the color of caret using caret-color property in CSS. &lt;/p&gt;

&lt;h2&gt;
  
  
  Code-
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;input {
  caret-color: red;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result -
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4Wkb_KnR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jgrmezknmbf03qqa5fv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4Wkb_KnR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jgrmezknmbf03qqa5fv7.png" alt=" RED caret-color " width="880" height="307"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Resources -
&lt;/h1&gt;

&lt;p&gt;1) &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/caret-color"&gt;caret-color MDN Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>css</category>
      <category>beginners</category>
    </item>
    <item>
      <title>#26 Guess The Output ???</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Sun, 10 Apr 2022 16:41:08 +0000</pubDate>
      <link>https://dev.to/shamgurav96/26--2hhd</link>
      <guid>https://dev.to/shamgurav96/26--2hhd</guid>
      <description>&lt;p&gt;⭐ Reply with correct answer &amp;amp; Bonus points for explanation ⚡&lt;/p&gt;

&lt;p&gt;💡 Correct answer with detailed explanation will be updated in comments after 48 hours.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wFLFfWwd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4v1qah0ujxad93dw7dj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wFLFfWwd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4v1qah0ujxad93dw7dj.png" alt="#26 Guess The Output ??? " width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function foo1() {
  return {
    bar: 'Hello'
  }
}

function foo2() {
  return
  {
    bar: 'World'
  }
}

console.log(foo1());
console.log(foo2());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>( HTML Tip ⚡ ) - Specify Fallback Image if Actual Image not found</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Sun, 10 Apr 2022 12:42:38 +0000</pubDate>
      <link>https://dev.to/shamgurav96/-html-tip-specify-fallback-image-if-actual-image-not-found-jio</link>
      <guid>https://dev.to/shamgurav96/-html-tip-specify-fallback-image-if-actual-image-not-found-jio</guid>
      <description>&lt;p&gt;Use onerror event When you need to specify a backup image in case if the actual image is not found or not available on the server for any reason.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="image.gif" 
onerror="this.onerror = null ; this.src = 'imagenotfound.gif' "&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Note - The reason we have the "this.onerror=null" in the function is that the browser will be stuck in an endless loop if the onerror image itself generates an error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources -
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror"&gt;https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>html</category>
    </item>
    <item>
      <title>( JavaScript Tip 💡 ) - delete Operator</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Sun, 10 Apr 2022 09:16:53 +0000</pubDate>
      <link>https://dev.to/shamgurav96/-javascript-tip-delete-operator-1i5k</link>
      <guid>https://dev.to/shamgurav96/-javascript-tip-delete-operator-1i5k</guid>
      <description>&lt;p&gt;delete operator is lesser-known operator in JavaScript. This operator is more specifically used to delete JavaScript object properties.&lt;/p&gt;

&lt;p&gt;The delete operator removes a property from an object; if no more references to the same property are held, it is eventually released automatically.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const User = {
  firstName: 'John',
  lastName: 'Wick'
};
​
delete User.lastName;
​
console.log(User);
// Output: { firstName: "John" }

console.log(User.lastName);
// Output - undefined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the property which you are trying to delete does not exist, delete will not have any effect and will return true.&lt;/p&gt;

&lt;p&gt;If a property with the same name exists on the object's prototype chain, then, after deletion, the object will use the property from the prototype chain (in other words, delete only has an effect on own properties).&lt;/p&gt;

&lt;p&gt;Note - delete operator doesn’t delete property value rather the property itself.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>#25 Guess The Output ???</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Sun, 10 Apr 2022 09:10:05 +0000</pubDate>
      <link>https://dev.to/shamgurav96/25--1cmm</link>
      <guid>https://dev.to/shamgurav96/25--1cmm</guid>
      <description>&lt;p&gt;⭐ Reply with correct answer &amp;amp; Bonus points for explanation ⚡&lt;/p&gt;

&lt;p&gt;💡 Correct answer with detailed explanation will be updated in comments after 48 hours.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [35, 2, 4, 11, 7];
numbers.sort();
console.log(numbers[2]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>:empty Selector In CSS</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Fri, 08 Apr 2022 15:10:24 +0000</pubDate>
      <link>https://dev.to/shamgurav96/empty-selector-in-css-2pbo</link>
      <guid>https://dev.to/shamgurav96/empty-selector-in-css-2pbo</guid>
      <description>&lt;p&gt;The :empty CSS pseudo-class represents any element that has no children. Children can be either element nodes or text (including whitespace). &lt;/p&gt;

&lt;p&gt;HTML Code -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div&amp;gt; Hello World !!!&amp;lt;/div&amp;gt;
&amp;lt;div&amp;gt; &amp;lt;!-- Empty --&amp;gt; &amp;lt;/div&amp;gt;
&amp;lt;div&amp;gt; GoodBye World !!! &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CSS Code -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;div:empty {
     background-color: #ff0000;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output - &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7Eaf6kKv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wz3gmd7ava3pew8824f7.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Eaf6kKv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wz3gmd7ava3pew8824f7.PNG" alt=":empty Selector Demonstration" width="530" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>css</category>
    </item>
    <item>
      <title>( ⭐ HTML Tip ⭐ ) - Hidden Property</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Fri, 25 Mar 2022 07:46:08 +0000</pubDate>
      <link>https://dev.to/shamgurav96/-html-tip-hidden-property-42b8</link>
      <guid>https://dev.to/shamgurav96/-html-tip-hidden-property-42b8</guid>
      <description>&lt;p&gt;No need to use CSS to hide stuff.&lt;br&gt;
Instead of "display:none" , You can use hidden property to hide element directly from HTML. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PZdn8jai--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/icrxcdmnv2u3t7gh7xky.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PZdn8jai--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/icrxcdmnv2u3t7gh7xky.jpg" alt="HTML Hidden" width="880" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>#9 Guess the output ???</title>
      <dc:creator>Sham Gurav</dc:creator>
      <pubDate>Thu, 24 Mar 2022 13:41:05 +0000</pubDate>
      <link>https://dev.to/shamgurav96/9-guess-the-output--15ll</link>
      <guid>https://dev.to/shamgurav96/9-guess-the-output--15ll</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getUserId(...args) {
  console.log(typeof args);
}

getUserId(21);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Options - &lt;br&gt;
A) string&lt;br&gt;
B) number&lt;br&gt;
C) object&lt;br&gt;
D) NaN&lt;/p&gt;

&lt;p&gt;Reply with correct answer &amp;amp; WHY it is correct answer in comments.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
