<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Js on Samarthya</title><link>https://samarthya.me/tags/js/</link><description>Recent content in Js on Samarthya</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© Samarthya 2018-2026. All rights reserved.</copyright><lastBuildDate>Sat, 11 Jan 2020 12:00:00 +0000</lastBuildDate><atom:link href="https://samarthya.me/tags/js/index.xml" rel="self" type="application/rss+xml"/><item><title>Handshake: JS</title><link>https://samarthya.me/posts/handshake-js/</link><pubDate>Sat, 11 Jan 2020 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/handshake-js/</guid><description>&lt;h1 class="relative group"&gt;Secret Handshake&#10; &lt;div id="secret-handshake" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#secret-handshake" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h1&gt;&#10;&lt;p&gt;Objective was relatively simple.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A numeral will be provided as input.&lt;/li&gt;&#10;&lt;li&gt;Based on the binary equivalent, one needs to compute the secret handshake.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Rule for handshake.&lt;/p&gt;</description></item><item><title>Maths problem in JS</title><link>https://samarthya.me/posts/maths-problem-in-js/</link><pubDate>Fri, 10 Jan 2020 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/maths-problem-in-js/</guid><description>&lt;h2 class="relative group"&gt;Objective&#10; &lt;div id="objective" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#objective" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Solve a simple math problem.&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;p&gt;Parse and evaluate simple math word problems returning the answer as an integer.&lt;/p&gt;&#10;&lt;/blockquote&gt;</description></item><item><title>JS Reduce and forEach</title><link>https://samarthya.me/posts/js-reduce-and-foreach/</link><pubDate>Sun, 15 Dec 2019 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/js-reduce-and-foreach/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Matrix"&#10; width="4096"&#10; height="2304"&#10; src="https://samarthya.me/posts/js-reduce-and-foreach/img_20160902_171750_hu_98c582a5f9430fd4.jpg"&#10; srcset="https://samarthya.me/posts/js-reduce-and-foreach/img_20160902_171750_hu_98c582a5f9430fd4.jpg 800w, https://samarthya.me/posts/js-reduce-and-foreach/img_20160902_171750_hu_91eec9143170a7c8.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/js-reduce-and-foreach/img_20160902_171750.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;I have been polishing my Go and JS skills recently and today learned about how to use the &lt;a href="https://www.w3schools.com/jsref/jsref_reduce.asp" target="_blank" rel="noreferrer"&gt;reduce&lt;/a&gt;() and &lt;a href="https://www.w3schools.com/jsref/jsref_foreach.asp" target="_blank" rel="noreferrer"&gt;forEach&lt;/a&gt;() method. The problem I was trying to solve was return columns and rows from an input string.&lt;/p&gt;</description></item><item><title>Optimizing in JS</title><link>https://samarthya.me/posts/optimizing-in-js/</link><pubDate>Fri, 13 Dec 2019 12:00:00 +0000</pubDate><guid>https://samarthya.me/posts/optimizing-in-js/</guid><description>&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="auto"&#10; alt="Sonic the hedgehog"&#10; width="1920"&#10; height="2048"&#10; src="https://samarthya.me/posts/optimizing-in-js/img_20191204_212744-scaled-e1576230534272_hu_c6eaedf488cc788e.jpg"&#10; srcset="https://samarthya.me/posts/optimizing-in-js/img_20191204_212744-scaled-e1576230534272_hu_c6eaedf488cc788e.jpg 800w, https://samarthya.me/posts/optimizing-in-js/img_20191204_212744-scaled-e1576230534272_hu_93cbfb4b8bf3dfcf.jpg 1280w"&#10; sizes="(min-width: 768px) 50vw, 65vw"&#10; data-zoom-src="https://samarthya.me/posts/optimizing-in-js/img_20191204_212744-scaled-e1576230534272.jpg"&gt;&lt;/figure&gt;&#10;&lt;p&gt;You never stop learning is not just a phrase, it is something I live everyday. Today, I was just trying out my skills with JS and was solving an innocuous problem, in JS.&lt;/p&gt;</description></item></channel></rss>