<?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: Monu Kumar</title>
    <description>The latest articles on DEV Community by Monu Kumar (@monukmodi).</description>
    <link>https://dev.to/monukmodi</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%2F282557%2Fbd4fa67d-5f0c-4449-b6a6-2ed274a2483f.png</url>
      <title>DEV Community: Monu Kumar</title>
      <link>https://dev.to/monukmodi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/monukmodi"/>
    <language>en</language>
    <item>
      <title>Function to Efficiently Reverse Alternate K-length Chunks of a String In Javascript</title>
      <dc:creator>Monu Kumar</dc:creator>
      <pubDate>Sat, 21 Jan 2023 07:50:14 +0000</pubDate>
      <link>https://dev.to/monukmodi/function-to-efficiently-reverse-alternate-k-length-chunks-of-a-string-in-javascript-lan</link>
      <guid>https://dev.to/monukmodi/function-to-efficiently-reverse-alternate-k-length-chunks-of-a-string-in-javascript-lan</guid>
      <description>&lt;p&gt;In this article, we will be discussing a code snippet that demonstrates how to reverse alternate chunks of a string. The code defines a function called strRevChunk(str, k) that takes in two parameters: a string str and an integer k.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufyil4vgxywge1b47vx5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fufyil4vgxywge1b47vx5.png" alt="Image description" width="629" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A “chunk” is defined as a substring of the original string, with a length of “k” characters. The loop starts at the first character of the string (index 0) and increments by “k” characters each time, so it will grab chunks of the string in the following order: 0-k, k-2k, 2k-3k, etc.&lt;/p&gt;

&lt;p&gt;If the current index (i) of the loop is divisible by 2*k, the function takes the current chunk and reverses it using the .split(), .reverse(), and .join() methods. Otherwise, it simply assigns the current chunk to a variable “chunk1” without reversing it.&lt;/p&gt;

&lt;p&gt;The reversed or non-reversed chunk is then added to the “chunkStr” variable, which is initially an empty string. Once the loop completes, the “chunkStr” variable will contain the modified version of the original string, with chunks reversed every other iteration. The function then returns the modified “chunkStr” variable.&lt;/p&gt;

&lt;p&gt;`function strRevChunk(str, k) {&lt;br&gt;
  let strLen = str.length&lt;br&gt;
  let chunk1, chunk2&lt;br&gt;
  let chunkStr = ""&lt;br&gt;
  for (let i = 0; i &amp;lt; strLen; i += k) {&lt;br&gt;
    if (i % (2*k) == 0) {&lt;br&gt;
      chunk1 = str.substr(i, k).split('').reverse().join('')&lt;br&gt;
    } else {&lt;br&gt;
      chunk1 = str.substr(i, k)&lt;br&gt;
    }&lt;br&gt;
    chunkStr += chunk1&lt;br&gt;
  }&lt;br&gt;
  return chunkStr&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;let str1 = 'abcdefghijkl'&lt;br&gt;
console.log(strRevChunk(str1, 2))`&lt;/p&gt;

&lt;p&gt;The code block also contains an example of how the function is used, where str1 = ‘abcdefghijkl’ and k = 2. Here we can see the function is called with str1 and 2 as its arguments, and the function will return the modified string “badcefghijkl”&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let str1 = 'abcdefghijkl'&lt;br&gt;
console.log(strRevChunk(str1, 2))&lt;br&gt;
Output - badcefghijkl&lt;/code&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Set up Mining Rig for Crypto Mining?</title>
      <dc:creator>Monu Kumar</dc:creator>
      <pubDate>Wed, 21 Oct 2020 08:55:35 +0000</pubDate>
      <link>https://dev.to/monukmodi/how-to-set-up-mining-rig-for-crypto-mining-16l6</link>
      <guid>https://dev.to/monukmodi/how-to-set-up-mining-rig-for-crypto-mining-16l6</guid>
      <description>&lt;p&gt;How can we set up a mining rig for crypto mining like BTC, ETH... &lt;br&gt;
What will be the cost of a complete setup and all necessary things to mine crypto?&lt;/p&gt;

</description>
      <category>blockchain</category>
    </item>
    <item>
      <title>React Developer Tools</title>
      <dc:creator>Monu Kumar</dc:creator>
      <pubDate>Thu, 08 Oct 2020 20:35:03 +0000</pubDate>
      <link>https://dev.to/monukmodi/react-developer-tools-2e49</link>
      <guid>https://dev.to/monukmodi/react-developer-tools-2e49</guid>
      <description>&lt;p&gt;You can go through this link and you will get to know about top react developer tools.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Module not found: Can't resolve 'react-dom' in 'C:\Users\Public\Desktop\mytestapp\src'"".</title>
      <dc:creator>Monu Kumar</dc:creator>
      <pubDate>Fri, 29 Nov 2019 22:09:59 +0000</pubDate>
      <link>https://dev.to/monukmodi/module-not-found-can-t-resolve-react-dom-in-c-users-public-desktop-mytestapp-src-g95</link>
      <guid>https://dev.to/monukmodi/module-not-found-can-t-resolve-react-dom-in-c-users-public-desktop-mytestapp-src-g95</guid>
      <description>&lt;p&gt;Recently I installed node and configured create-react-app, I created one react app and when I am doing npm start it is giving an error "" ./src/index.js Module not found: Can't resolve 'react-dom' in 'C:\Users\Public\Desktop\mytestapp\src'"". then I removed this and again installed it, but the same error is giving again and again.&lt;br&gt;
I am unable to solve this issue&lt;/p&gt;

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