<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Raz Gaon on Medium]]></title>
        <description><![CDATA[Stories by Raz Gaon on Medium]]></description>
        <link>https://medium.com/@razgaon?source=rss-6154f82ebb66------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*e1CtdJKIAAQ6cuwXzXcRtg.jpeg</url>
            <title>Stories by Raz Gaon on Medium</title>
            <link>https://medium.com/@razgaon?source=rss-6154f82ebb66------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 20:25:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@razgaon/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[5 Questions to Test Your JavaScript Knowledge]]></title>
            <link>https://javascript.plainenglish.io/5-questions-to-test-your-javascript-knowledge-9371c39b74c3?source=rss-6154f82ebb66------2</link>
            <guid isPermaLink="false">https://medium.com/p/9371c39b74c3</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Raz Gaon]]></dc:creator>
            <pubDate>Wed, 24 Jun 2020 12:33:43 GMT</pubDate>
            <atom:updated>2020-07-09T07:36:54.988Z</atom:updated>
            <content:encoded><![CDATA[<p>In case you missed part 1:</p><p><a href="https://blog.usejournal.com/5-questions-to-test-your-javascript-knowledge-968e3f15779b">5 Questions to Test Your JavaScript Knowledge</a></p><h3>Mathematical Operations</h3><p>const num = 1 / 0;</p><p>What is the value of num?<br>Do we get an error from this operation?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vdUQvRHh18JECpd6" /><figcaption>Photo by <a href="https://unsplash.com/@ikukevk?utm_source=medium&amp;utm_medium=referral">Kevin Ku</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Answer</h3><p>The value of num will be Infinity .</p><h3>Explanation</h3><p>JavaScript currently has eight data types:</p><pre>number<br>bigint<br>string<br>boolean<br>null<br>undefined<br>object<br>symbol</pre><p>Variables of type number have a few edge-case definitions. Infinity and -Infinity represent the values of infinity. Nan (not a number) is a result of an invalid mathematical operation. It’s important to note that JavaScript will <strong>not</strong> throw an error on invalid mathematical operations, but instead will return a Nan value (Not a number).</p><p>Understanding these edge cases is helpful because you will be aware of the ‘silent’ errors (logical errors that don’t throw exceptions).</p><h3>What to learn</h3><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity">Infinity</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a></p><h3>Querying the DOM</h3><p>What is the difference between querySelectorAll and getElementsBy*?<br>(getElementsByClassName, getElementsByTagName, etc)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*Y6hTqH_Phgl2Q3DXkVBkSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*T4bgVQOYMLheRwbIiT-xrg.png" /><figcaption>Selecting elements from the script</figcaption></figure><h3>Answer</h3><p>The main difference is that querySelector returns a <strong>static </strong>collection that represents a snapshot of the element <strong>at the time of execution </strong>and getElementsBy* returns a ‘<strong>live</strong>’, auto-updating htmlCollection object.</p><h3>Explanation</h3><p>First, we need to understand the difference between ‘live’ and ‘static’ collections. A ‘live’ collection means it auto-updates when the DOM changes and always reflects the current state of the DOM. A ‘static’ collection returns a snapshot of the element and doesn’t update if the element updates. This means that if we update the elements after we selected them via querySelector , our selected elements will not accurately reflect the DOM.</p><blockquote>getElementsBy* return a HtmlCollection which auto-updates as the DOM changes. querySelectorAll returns a NodeList which doesn’t auto-update.</blockquote><h3>What to learn</h3><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll">querySelectorAll</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName">getElementsByClassName</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection">HtmlCollection</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/API/NodeList">NodeList</a></p><h3>Variable declaration</h3><p>Describe what will happen in each scenario.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f0c7920a7d6a659e047e4233873fd874/href">https://medium.com/media/f0c7920a7d6a659e047e4233873fd874/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8516820cccb8f27194e53640dc502676/href">https://medium.com/media/8516820cccb8f27194e53640dc502676/href</a></iframe><h3>Answer</h3><p>In the first scenario, the program will log undefined to the console.<br>In the second scenario, we will get an error:</p><pre>Uncaught ReferenceError: Cannot access &#39;name&#39; before initialization</pre><h3>Explanation</h3><p>Let and const were introduced in 2015 in ES6. Before, variables were declared using var.</p><p>When processing a var statement, JavaScript does something called <strong>hoisting</strong>.</p><blockquote><em>Hoisting — an act of raising or lifting something. (Vocabulary)</em></blockquote><p>This is how the code in the first example is altered:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b11f8d15b52adb6e3a3e8cdf92a342a8/href">https://medium.com/media/b11f8d15b52adb6e3a3e8cdf92a342a8/href</a></iframe><p>Because of this, when the program attempts to log name to the console, it logs undefined. Because there is no hoisting with let , the program doesn’t recognize it when trying to console log and throws an error.</p><p>Another main difference between var and let is the <strong>scope</strong>. var uses <strong>function </strong>scope and let uses <strong>block </strong>scope.</p><p><strong>Function scope </strong>— the variable is known and shared throughout the whole function</p><p><strong>Block scope </strong>— the variable is known only in its own block (function, for loop, if statement, etc).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6a0adae01eb14e482ae5bef975c47c5/href">https://medium.com/media/c6a0adae01eb14e482ae5bef975c47c5/href</a></iframe><p>In the sun function, letter is known in the function’s scope and is available to use anywhere inside. In the moon function, letter is known only in the scope of the if statement. For this reason, an error is thrown when trying to access it from outside (the function scope).</p><blockquote>The two main differences between var and let are scope and hoisting.</blockquote><p>Understanding var’s special behavior is important when migrating old code or copying code from the internet. I believe that understanding it will help you avoid potential bugs in the future.</p><h3>What to learn</h3><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var">var</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let">let</a></p><h3>Storage</h3><p>How can we store information in the client’s browser? <br>The information needs to be persistent, shared across all the program’s tabs, and survive browser restarts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wKSWQKVJ2RVMkJY1" /><figcaption>Photo by <a href="https://unsplash.com/@ruchindra?utm_source=medium&amp;utm_medium=referral">Ruchindra Gunasekara</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Answer</h3><p>Using localStorage.</p><h3>Explanation</h3><p>The browser provides us with a Storage object to handle storing information on the browser. We use localStorage if we want to store data that is:</p><ul><li>Persistent (doesn’t disappear after the browser is closed).</li><li>Shared across all tabs of the website.</li><li>Not needed on the server.</li></ul><p>An example of using localStorage:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66b5a594f8bfb300f32225b4e7924392/href">https://medium.com/media/66b5a594f8bfb300f32225b4e7924392/href</a></iframe><blockquote>Note: localStorage is an extension of window.localStorage</blockquote><p>To access a page’s local storage in chrome, open chrome dev tools(f12), click on the Application tab, then click on Local Storage under the Storage section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7oTNVvB2wDq9IGG2R8wYRw.png" /></figure><p><strong>Bonus</strong>: If we have a few tabs of our program and we want each to have a distinct configuration, we can use <strong>session storage</strong>. But remember that if we want to share the same properties <strong>across tabs</strong>, we should use local storage.</p><blockquote>Session storage is specific for tabs. Local storage is specific for browsers.</blockquote><h3>What to learn</h3><p><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage">localStorage</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage">sessionStorage</a></p><h3>Iterators</h3><p>What will be logged to the console in each line?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6f973d607bb051550dd76f68696037e/href">https://medium.com/media/b6f973d607bb051550dd76f68696037e/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1IqaWh_0kVfKh1lK" /><figcaption>Photo by <a href="https://unsplash.com/@cdr6934?utm_source=medium&amp;utm_medium=referral">Chris Ried</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Answer</h3><pre>numbers: [1,2,3,4]<br>doubleNumbersByMap: [2,4,6,8]<br>doubleNumbersByForEach: undefined</pre><h3>Explanation</h3><p><strong>numbers</strong></p><p>numbers does not change because forEach and for of do <strong>not </strong>mutate the arrays they are called on.</p><p><strong>doubleNumbersByMap</strong></p><p>Map iterates over the array and returns a new array modified by the callback function. Thus, doubleNumbersByMap is a new array containing values twice as numbers.</p><p><strong>doubleNumbersByForEach</strong></p><p>doubleNumbersByForEach is undefined because forEach returns undefined.</p><p>forEach() executes the callback function once for each array element; unlike map or reduce, it always <strong>returns </strong>the value undefined. Typically, we use if to execute <strong>side effects </strong>on an iterable object. forEach() does <strong>not </strong>mutate the original array on which it was called.</p><p><strong>Bonus</strong></p><p>If we want to update numbers using the forEach method, we need to use the array property in the callback. This allows us to access the original array and modify it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b062bf23962a2902cf6e762da626ade/href">https://medium.com/media/0b062bf23962a2902cf6e762da626ade/href</a></iframe><p>Here we can see the syntax of the forEach method.</p><pre>arr.forEach(callback(currentValue [, index [, array]])[, thisArg])</pre><h3>What to learn</h3><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach">forEach</a><br><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map">Map</a></p><h3>Conclusion</h3><p>In this session, we went over a few more important concepts in JavaScript. These topics often pop up in interviews so I hope you’re prepared!</p><p>Thanks for reading!</p><h4><strong>In Plain English</strong></h4><p>Did you know that we have four publications? Find them all via <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> — show some love by following our publications and <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>subscribing to our YouTube channel</strong></a><strong>!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9371c39b74c3" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/5-questions-to-test-your-javascript-knowledge-9371c39b74c3">5 Questions to Test Your JavaScript Knowledge</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Complete Guide To Npm]]></title>
            <link>https://medium.com/analytics-vidhya/the-complete-guide-to-npm-ac52fbc43f6c?source=rss-6154f82ebb66------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac52fbc43f6c</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Raz Gaon]]></dc:creator>
            <pubDate>Mon, 25 May 2020 16:18:55 GMT</pubDate>
            <atom:updated>2020-05-29T16:37:43.323Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*6UYEOgkekbzX3yaXCzmO5g.jpeg" /></figure><p><a href="https://www.npmjs.com/">Npm</a> (Node package manager) is the standard package manager of the <a href="https://medium.com/swlh/node-js-explained-dad7b23d027d">Node.js </a>ecosystem. It’s the most extensive online package repository, containing over one-million packages. Also, it’s a command-line interface tool used by developers to manage their Node.js projects. Developers all around the world use npm to share their software. React, Vue, Express, and Angular are some great examples.</p><h3>Npm for dummies</h3><p><em>This section is for explaining npm using analogies. You can skip if you understand the concept of software packages.</em></p><p>Let’s say that you want to build a laptop. Would you create the CPU, RAM, screen, software, cameras, by yourself? No. You would probably order most of the parts from different manufacturers (Snapdragon, AMD, Intel, etc.). <strong>Instead of creating everything from scratch, you use various components made by separate entities.</strong> This is essentially the goal of software packages. There is no need for every back-end developer to create a framework to handle HTTP requests; indeed, most developers use existing frameworks like Express, Fastify, Meteor, etc.</p><h4>Real-life example</h4><p>Gatsby (static React site generator) depends on Express.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1R99HSgqnCOgUn65GsHpHA.png" /><figcaption><a href="https://www.npmjs.com/">https://www.npmjs.com/</a></figcaption></figure><p>Express depends on cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wxaA7SKv5PLfbOt0ztjHGQ.png" /><figcaption><a href="https://www.npmjs.com/">https://www.npmjs.com/</a></figcaption></figure><p>Cookie doesn’t depend on any library (uses plain javascript).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8MAOohFgHQIVss9PUn2gw.png" /><figcaption><a href="https://www.npmjs.com/">https://www.npmjs.com/</a></figcaption></figure><h3>Stats</h3><p>Npm is used tremendously by the community. The graph below depicts the number of downloads every day in the past<strong> </strong>two years<strong> </strong>for the most popular web frameworks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9AaTS3zkQKDgxP9pzLIEw.png" /><figcaption>h<a href="https://www.npmtrends.com/">ttps://www.npmtrends.com/</a></figcaption></figure><h3>package.json</h3><p>A standard Node.js project contains a file called package.json. It is a JSON manifest file which holds all of the relevant data to the app. Just like the manager of a restaurant who holds information about the restaurant, the workers, and the different vendors.</p><p>Here is how a short basic package.json looks like:</p><pre>&quot;name&quot;: &quot;vreangular&quot;, // see what I did there?<br>&quot;version&quot;: &quot;0.0.1&quot;,<br>&quot;description&quot;: &quot;&quot;,<br>&quot;author&quot;: &quot;Evan Boo&quot;,<br>&quot;license&quot;: &quot;MIT&quot;,<br>&quot;dependencies: {...},<br>&quot;devDependencies: {...},<br>&quot;scripts&quot;: {...},</pre><p>name, author, license, description — Important if you want to publish your repository.</p><p><strong>Version </strong>— If you are maintaining an open-source npm package, you should update it according to the semantic conventions. 3.7.2– 3 is the major version, 7 is the minor version, and 2 is the patch.</p><p><strong>scripts</strong></p><p>Here we put out project’s scripts: building, testing, linting, deploying, etc. Each project can have custom-made scripts adapted for a unique use-case. Custom scripts can be added and used by developers to enhance development capabilities. For example, executing end-to-end tests in a specific directory.</p><pre>&quot;scripts&quot;: {<br>  &quot;prebuild&quot;: &quot;rimraf dist&quot;,<br>  &quot;build&quot;: &quot;nest build&quot;,<br>  &quot;start&quot;: &quot;nest start&quot;,<br>  &quot;lint&quot;: &quot;tslint -p tsconfig.json -c tslint.json&quot;,<br>  &quot;test&quot;: &quot;jest&quot;,<br>}</pre><p><strong>dependencies</strong></p><p>Required for building the project. They are specified in a simple object that maps a package name to a version range. The version range is a string that complies with a specific syntax.</p><pre>&quot;dependencies&quot;: {<br>  &quot;@hapi/joi&quot;: &quot;^17.1.1&quot;,<br>  &quot;@nestjs/common&quot;: &quot;^7.0.7&quot;,<br>  &quot;@nestjs/config&quot;: &quot;^0.4.0&quot;,<br>  &quot;@nestjs/core&quot;: &quot;^7.0.7&quot;<br>}</pre><p><strong>devDependencies</strong></p><p>The dependencies needed only for the development of the project but not for building it. For example, testing frameworks are not bundled into the final code build but are used only in development.</p><pre>&quot;devDependencies&quot;: {<br>  &quot;@nestjs/cli&quot;: &quot;^7.1.2&quot;,<br>  &quot;@nestjs/schematics&quot;: &quot;^7.0.0&quot;,<br>  &quot;@nestjs/testing&quot;: &quot;^7.0.7&quot;,<br>  &quot;@types/express&quot;: &quot;^4.17.4&quot;<br>}</pre><h3>package-lock.json</h3><p><strong>package-lock.json</strong> is generated automatically for any operations where npm modifies either the <strong>node_modules</strong> tree, or <strong>package.json</strong>. It describes the exact tree that was generated, such that subsequent installs can generate identical trees. This is used to save an <strong>exact</strong> copy of the packages to ensure that the program works the same on different machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fRKb-1WB5S2mqQxhjJCA2w.png" /></figure><p>This file is intended to be committed into source repositories, and serves various purposes:</p><ul><li>Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install the same dependencies.</li><li>Keeps the exact state of node_modules in the project without the need to commit the whole node_modules folder into the source control.</li></ul><h3>node_modules</h3><p>When you run npm install, npm installs the required packages into your project root directory in a folder called node_modules. The folder&#39;s size is usually above 150Mb for large projects, and it&#39;s a major headache for developers who have many projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*jttYIBMLaux2iuPxFz_xuQ.png" /><figcaption>Directories inside node_modules</figcaption></figure><p>npm can install packages in local or global mode. If the flag -g is used, npm installs the package into the current user’s root directory. To find globally installed npm modules in windows, open the windows search, and type %appdata%. There is a folder named npm — the global packages reside there.</p><p>When installing packages globally, we install them per user and not per project. There are cases when this is not advised, such as working on multiple projects with different versions of the same package — for example, working with Angular 5 and Angular 9.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/0*iFqABR0dOPGP02nT.jpeg" /><figcaption>It really is a large folder</figcaption></figure><h3>Npm commands</h3><h4>Installing project dependencies</h4><p><strong>npm</strong> can install all the dependencies of a project in a single command. This command is usually used when we clone a new project.</p><p>npm install</p><p>The script will always install dependencies according to the current package.json. If the specifications change and you run the command again, it will install packages according to the new specifications.</p><h4>Executing a script</h4><p>npm run script_name where the script name is defined in the package.json (<em>build, test:e2e, etc.).</em></p><h4>Installing a dev dependency</h4><p>npm install jest -D -D saves the package as a dev dependency and doesn&#39;t bundle it in the build.</p><h4>List global packages</h4><p>Shows us all of the global packages for the current user.<br>npm list --global</p><h3>Yarn</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*kNFANIfHZWUrGBLSrCP47Q.png" /><figcaption><a href="https://yarnpkg.com/">https://yarnpkg.com/</a></figcaption></figure><p>We can’t talk about npm without mentioning Yarn. Yarn is an alternative client created by Facebook engineers. It is important to note that Yarn is not a different repository for storing node packages, but a different client to handle the work with the repository.</p><h3>Conclusion</h3><p>Whoo! We covered many concepts today. Quick recap:</p><ol><li>Npm is mainly a repository containing Node.js projects.</li><li>Packages are useful for building reusable code and sharing code.</li><li>package.json is the manifest of a node.js project.</li><li>package-lock.json stores the exact package versions.</li><li>node_modules is the folder containing all of the dependencies of the project</li><li>Yarn is an alternative client built by Facebook engineers to work with Node.js packages.</li></ol><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac52fbc43f6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/the-complete-guide-to-npm-ac52fbc43f6c">The Complete Guide To Npm</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Questions to Test Your JavaScript Knowledge]]></title>
            <link>https://medium.com/@razgaon/5-questions-to-test-your-javascript-knowledge-968e3f15779b?source=rss-6154f82ebb66------2</link>
            <guid isPermaLink="false">https://medium.com/p/968e3f15779b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Raz Gaon]]></dc:creator>
            <pubDate>Sun, 24 May 2020 18:21:42 GMT</pubDate>
            <atom:updated>2020-07-20T08:51:55.439Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D3aJSq4VoZzjPgxl" /><figcaption>Photo by <a href="https://unsplash.com/@emilep?utm_source=medium&amp;utm_medium=referral">Emile Perron</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Functions</h3><p>We have a programmer object containing three properties: name, languages, and printLanguages. printLanguages is a method that prints all the languages known to the programmer.</p><p>What will be printed in each scenario?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/811bf2cd9adc7ec8647e5ac1cf431fc1/href">https://medium.com/media/811bf2cd9adc7ec8647e5ac1cf431fc1/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaff2069dd642a8f53532a557c5dbd66/href">https://medium.com/media/eaff2069dd642a8f53532a557c5dbd66/href</a></iframe><blockquote><em>Want to read this story later? Save it in </em><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=blog&amp;utm_campaign=noteworthy&amp;utm_content=eid7"><em>Journal</em></a><em>.</em></blockquote><h4>Answer</h4><p>First scenario:</p><pre>raz knows: JavaScript<br>raz knows: Python<br>raz knows: Go<br>raz knows: Java</pre><p>Second scenario:</p><pre>// Error: Cannot read property &#39;name&#39; of undefined</pre><h4>Explanation</h4><p>In the first scenario, the arrow function inside the forEach doesn’t have its own scope and thus uses the same this object as the programmer object. Using the same this as programmer enables access for the name property.</p><p>In the second scenario, the function inside the forEach has no this. Hence, trying to access this.name inside the function is equivalent to undefined.name.</p><p>Because arrow functions inherit the this from the outer method, they are able to use external properties.</p><p>Bonus: what happens if we don’t use strict mode in the second scenario?</p><p>Answer: this will point to the global window object instead of undefined. (second scenario). window.name will be used as this.name</p><h4>What to learn</h4><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this">Scopes </a>between different types of functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5krHwsR_3R-BZWlm" /><figcaption>Photo by <a href="https://unsplash.com/@robwingate?utm_source=medium&amp;utm_medium=referral">Rob Wingate</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Reduce</h3><p>Given an array of letters, return an object containing each letter and number of appearances in the array.</p><p>[‘a’, ‘b’, ‘a’, ‘d’, ‘b’, ‘a’] -&gt; {a: 3, b: 2, d: 1}</p><p>The question must be solved using the ‘reduce’ built-in function.</p><h4>Answer</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b089acaffa46109324dd858899fa6669/href">https://medium.com/media/b089acaffa46109324dd858899fa6669/href</a></iframe><h4>Explanation</h4><p>The key to this question is understanding that reduce can get an optional initial value as a second argument. A common pitfall programmers face in this question is where to generate an object to save the data.</p><p>Here is the prototype description of the reduce function:</p><pre>arr.reduce(callback( accumulator, currentValue[, index[, array]] )[, initialValue])</pre><h4>What to learn</h4><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce">Reduce function</a>.</p><h3>Promises</h3><p>The following gist shows two ways to execute a function that takes two seconds five times. How long will it take each function to execute from start to finish?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/624cfb052bc97f1aa2ae719761780bc1/href">https://medium.com/media/624cfb052bc97f1aa2ae719761780bc1/href</a></iframe><h4>Answer</h4><p>The first function will take 10 seconds from start to finish. The second will take 2 and a bit seconds to finish.</p><h4>Explanation</h4><p>The first function waits for each promise to resolve before continuing to the next one. The second function initiates all the promises together and waits for them all to finish.</p><p>Using promise.all is extremely helpful in many cases and it is important to keep an eye out to occurrences where it can boost performance.</p><h4>What to learn</h4><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Basic promises</a>.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all">Promise</a>.<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all">all</a></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop">Event-loop </a>(optional)</p><h3>Object Iteration</h3><p>Given an object:</p><pre>const colors = { red: 3, blue: 5, green: 2, yellow: 6 };</pre><p>How can you iterate over the object’s keys and values together? For example, one loop that can print the color and the number of occurrences.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/973e139a2467c891b9a0ec754d78e8fe/href">https://medium.com/media/973e139a2467c891b9a0ec754d78e8fe/href</a></iframe><h4>Answer</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UDHCRDtCTFsjoFGO" /><figcaption>Photo by <a href="https://unsplash.com/@nkachanovskyyy?utm_source=medium&amp;utm_medium=referral">Nikita Kachanovsky</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I needed the image so the answer won’t jump to your eye. :)</p><p>Use the Object.entries(obj) built-in function!</p><h4>Explanation</h4><p>Object.entries takes an object as an argument and returns an array of arrays containing the key at the first index and the value at the second. For our example:</p><pre>[[&#39;red&#39;, 3], [&#39;blue&#39;: 5], [&#39;green&#39;: 2], [&#39;yellow&#39;, 6]]</pre><h4>What to learn</h4><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries">Object.entries</a></p><h3>Asynchronous Execution</h3><p>What will be printed first, and why?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e1c65a6e61cc637c75a67b73f83f22c/href">https://medium.com/media/9e1c65a6e61cc637c75a67b73f83f22c/href</a></iframe><h4>Answer</h4><p>This question tests your understanding of asynchronous execution in JavaScript. It’s the first question asked in many interviews to check if the candidate has a basic understanding of how JavaScript works. The answer:</p><pre>2 // printed first<br>1 // printed second</pre><h4>Explanation</h4><p>This explanation consists of understanding the whole event-loop execution architecture.</p><p>JavaScript has a mechanism called the <strong>event-loop </strong>that is responsible for handling the execution of code. When an asynchronous function is executed, it’s transferred to a worker thread that runs without blocking the main thread. Once the execution is finished, the callback of the resolved function is placed in the callback queue. Once the call-stack is empty, it checks if there are functions in the callback queue and executes them.</p><p>In our example, the setTimeout function is a blocking function and is thus moved to be handled by a worker thread. The worker thread finishes in 0 seconds and places the callback in the callback queue. The second function is non-blocking and is executed once it’s placed on the call-stack. When the call-stack is empty, it takes the callback of the resolved first function from the callback queue and executes it.</p><p>This is quite a difficult concept to understand at first, and it usually requires further reading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*7l2hWO3bNzNWZgi0mqivRg.png" /><figcaption>Web-API uses worker threads to execute async tasks</figcaption></figure><h4>What to learn</h4><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop">Event-loop</a></p><h3>Conclusion</h3><p>In this session, we went over a few important concepts in JavaScript. Some are helpful in our daily work (promise.all) and some are helpful for job interviews (function scopes).</p><p>If you enjoyed, here is part 2:</p><p><a href="https://medium.com/javascript-in-plain-english/5-questions-to-test-your-javascript-knowledge-9371c39b74c3">5 Questions to Test Your JavaScript Knowledge</a></p><p>I hope you had fun and thanks for reading!</p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=blog&amp;utm_campaign=noteworthy&amp;utm_content=eid8"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ArLSH4tuI2v4pF0giI3-OQ.png" /></a></figure><p>📝 Save this story in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=968e3f15779b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asynchronous JavaScript Explained]]></title>
            <link>https://medium.com/swlh/asynchronous-javascript-explained-1aefc1304ac2?source=rss-6154f82ebb66------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aefc1304ac2</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Raz Gaon]]></dc:creator>
            <pubDate>Thu, 14 May 2020 18:02:35 GMT</pubDate>
            <atom:updated>2020-07-20T09:04:54.142Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wyu2_3MGrkyk8CwJ77PB2g.jpeg" /></figure><p>This article will explain the non-blocking nature of JavaScript and what patterns we as programmers can implement. The explanations will be complemented with short stories used as analogies. Enjoy!</p><p>Three months ago, I went to a restaurant. All the waiters were standing by the kitchen without doing anything. After a few minutes, a waiter took my order. After submitting my order he just waited <strong>without </strong>approaching other customers. Only after delivering me my pizza, he <strong>finally </strong>walked away to serve another table. All four waiters in that restaurant acted in the same peculiar way. Most of the customers were waiting to order but there were <strong>no </strong>available waiters to serve them. Open orders <strong>blocked</strong> the restaurant&#39;s ability to serve customers.</p><p>This behavior is known as <strong>blocking </strong>behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fBngXtV_lKvhQ0EH" /><figcaption>Photo by <a href="https://unsplash.com/@alanaktion?utm_source=medium&amp;utm_medium=referral">Alan Hardman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Our real experience in restaurants is different. We order from a waiter, the waiter sends the order to the kitchen and then moves on to take orders from other tables. When the food is ready, the kitchen notifies an available waiter to take the food to you. This is known as <strong>non-blocking</strong> behavior.</p><h3>Why Do We Need Non-Blocking Code?</h3><p>JavaScript is different from other programming languages because it can’t wait for events to finish. Let’s say a user clicked on a subscribe button on Youtube. Should Youtube pause and wait for a response from the server? If so, the user won’t be able to browse comments, watch the video, or do any other action on the website. Some websites have functions that can take 15 seconds — a long time to keep a user waiting. In order to handle this issue, JavaScript had to be implemented in a non-blocking asynchronous fashion. There are 3 different forms of non-blocking code in JavaScript:</p><ol><li>Callbacks</li><li>Promises</li><li>Async/Await</li></ol><h3>Callbacks</h3><p>In JavaScript, functions are objects, hence a function can take another function as an argument.</p><p>A callback is a function that is executed inside another function once some behavior completes. Let’s work with the restaurant example: I have a function that is called <em>cookMeal</em>. The function receives a callback function as an argument that is called serveMeal. The function <em>serveMeal </em>is automatically executed once <em>cookMeal </em>is done.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d77905932ee9a9ec870797433decfb95/href">https://medium.com/media/d77905932ee9a9ec870797433decfb95/href</a></iframe><p>So what is happening here? We have two functions: one for cooking the meal(the kitchen is responsible for doing kitchen things) and one for serving the meal(an available waiter takes the meal to the customer). What is the callback argument sent to <em>cookMeal</em>? It’s a function that will execute with the finished meal as its argument when <em>cookMeal </em>completes.</p><p>We told our program to execute the function <em>serveMeal </em>once the function <em>cookMeal </em>is finished. We make sure that <em>serveMeal </em>happens <strong>only</strong> after the meal is cooked, <strong>but, without blocking the program’s execution. </strong>This pattern is called the callback pattern and has many flaws, the biggest one being too many layers of callbacks — commonly known as “callback hell”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*Vec3296p-uyig8A7.jpeg" /><figcaption><a href="https://hackernoon.com/u/peterchang_82818">@peterchang_82818</a></figcaption></figure><h3>Promises</h3><p>The 6th edition of <a href="https://en.wikipedia.org/wiki/ECMAScript">ECMAScript</a>, initially known as ECMAScript 6 (<strong>ES6</strong>), later renamed to ECMAScript 2015, was finalized in June 2015. This version introduced promises — a new way to handle asynchronous tasks.</p><p>A promise is used for the same use cases as a callback — handling code with unknown completion time without blocking the program. For example, fetching data from an API that can take x seconds to respond.</p><p>To explain the terminology of promises I will use another analogy. <a href="https://www.youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA">Mr. Beast</a> is one of the best YouTubers out there. As an avid fan, I want to know when he releases his next video. How can I do that? I click on the subscribe button on his channel. Youtube “<strong>promises</strong>” me that when the video will come out, they will update me, and if the video won’t come out for any reason, they will send me a notice that a problem occurred. I continue with my life, and when the video is released, Youtube notifies me and I watch the video.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*SSUEb4Jt5dDY5Lyl" /><figcaption>Shot by Business Insider</figcaption></figure><p><strong>Diving deep</strong></p><p>A Promise takes as an argument a function called “executor”. The executor runs when a new Promise is created. The executor has two parameters: resolve — a callback that is called if the function executed successfully, and reject a callback that is called if an error occurred.</p><p>When the executor function finishes its tasks, it calls one of the callbacks: resolve(value) or reject(error)</p><p>The return value of a new Promise is a “promise” object. The object has 3 states: pending (the executor hasn’t finished), fulfilled (resolved was called), or rejected (reject was called).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*VUkYeHX8yoPgfqn5bsflzg.png" /></figure><p><strong>Mr.Beast example</strong>);</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8213b0b616b5c67607b505d31d0945a/href">https://medium.com/media/f8213b0b616b5c67607b505d31d0945a/href</a></iframe><p>In the example, we can see that I subscribed to Mr.Beast’s next video. The video has been uploaded and <strong>then</strong> Youtube updates the user. If there was a problem in uploading the video, Youtube <strong>catches </strong>the error and notifies the user. The user is <strong>not</strong> updated until <strong>after</strong> the video has finished uploading (or has had an error).</p><p>***</p><p>It is important to note that instead of callback hell, we can chain promises. If we want to execute a series of asynchronous functions sequentially, we chain them. <a href="https://javascript.info/promise-chaining">More reading</a>.</p><p>***</p><h3>Async/Await</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hawiQNyYh5eysqd3uopAwA.png" /></figure><p>ES8 (2018) introduced a new syntax to work with promises: “async/await”. The main improvement of the new syntax is revamping the way we write asynchronous code.</p><p><em>“In computer science, </em><strong><em>syntactic sugar</em></strong><em> is syntax within a programming language that is designed to make things easier to read or to express. It makes the language “sweeter” for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer.</em>” — Wikipedia</p><p>Async/await is actually just syntax sugar built on top of promises. It allows us to write asynchronous code in the <strong>same </strong>fashion we write synchronous code. The word “async” before a function means one simple thing: the function will return a <strong>promise </strong>and allow us to <strong>await </strong>other asynchronous functions inside. For instance, the following function returns a resolved promise with the result of “Fun”. let’s test it:</p><pre>async function haveFun() {<br>  return &quot;Fun!&quot;;<br>}</pre><pre>haveFun().then((result) =&gt; console.log(result)); // &quot;Fun&quot;</pre><p>Using <em>async</em> transforms our return value to a promise. The value we return from our function can be consumed just like any promise value and the function <strong>doesn’t block the main thread</strong>.</p><p>Now, what about the “await” keyword? Await is the equivalent of using .then on an async promise. It waits until the promise is either fulfilled or rejected.</p><p>Here is our previous example in the new syntax:</p><pre>uploadVideo() {<br>    // When the video is done,<br>    const video = ...<br>    return new Promise((resolve, reject) =&gt; {<br>        // Video related stuff - can take time<br>        try {<br>            resolve(video);<br>        } catch (err) {<br>            reject(err);<br>        }<br>})<br>}</pre><pre>async subscribe(){<br>    try{<br>      const video = await uploadVideo();<br>      notifyUserOfNewVideo(video);<br>    }catch(err){<br>      notifyUserOfError(err);<br>    }<br>}</pre><pre>subscribe();</pre><p>* <strong>Side note:</strong> <strong>await can only be used inside async functions!</strong></p><p>As you can see, instead of chaining a .thento our promise, we await it. If there was an error, our code catches it just like before! It is important to understand that inside our function, the code <strong>seems </strong>as if it is executed “synchronously” and is blocking the thread, but it isn’t because the function itself returns a promise which is non-blocking.</p><h3>Conclusion</h3><p>In this article, we talked about the asynchronous nature of JavaScript and learned about the various ways we can implement asynchronous behavior. We didn’t dive deep into the implementation, but I hope it helped you understand the basic concepts behind each method.</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1aefc1304ac2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/asynchronous-javascript-explained-1aefc1304ac2">Asynchronous JavaScript Explained</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Effective Ways To Improve Your Vocabulary]]></title>
            <link>https://medium.com/swlh/3-effective-ways-to-improve-your-vocabulary-bbf606813dfd?source=rss-6154f82ebb66------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbf606813dfd</guid>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[communication]]></category>
            <category><![CDATA[vocabulary]]></category>
            <category><![CDATA[personal-development]]></category>
            <dc:creator><![CDATA[Raz Gaon]]></dc:creator>
            <pubDate>Sat, 09 May 2020 12:23:37 GMT</pubDate>
            <atom:updated>2020-05-17T13:56:17.524Z</atom:updated>
            <content:encoded><![CDATA[<h3>3 Game-Changing Ways To Improve Your Vocabulary Quickly</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*SpgJdlJve2G5353j" /></figure><p>Remember that time when you read an article but didn’t quite understand it? We often use context as our guide when we meet unfamiliar words. A profound vocabulary improves textual understanding and provides ample ways to express yourself. <br>Knowing how to communicate eloquently can have a tremendous impact. It allows the sharing of ideas and thoughts with others, such as reading a book, watching a movie, talking with friends.</p><h3>My Personal Story</h3><p>My reason for expanding my vocabulary was the SAT. I have been living abroad for 15 years, and sadly, My English hasn’t improved as much over the years. Opening the SAT English test for the first time was a mortifying experience. I vigorously scavenged any available source on how to improve my vocabulary. The following list encompasses three highly effective ways I found to improve my vocabulary.</p><p>“<em>Foreign research on vocabulary learning strategies started in the 1960s, at first research focuses on the study of individual, by studying the learner’s behavior to observe their effect the change of learning a language. It was later discovered that successful language learners were </em><strong><em>not </em></strong><em>necessarily positively correlated with their intelligence, but rather with their own efforts and mastery of learning strategies</em>.”</p><p><em>(“An Analysis of English Vocabulary Learning Strategies” by Zhihong Bai, Shanxi Normal University, Linfen, China).</em></p><p><strong>As you can see, successfully building your vocabulary depends on using the correct strategies.</strong></p><h3>Vocabulary.com</h3><p><em>(I am not affiliated in any way with Vocabulary.com)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*esE7657SM2Md1_E43meExQ.png" /></figure><p>Many platforms teach vocabulary, but in my opinion, the pinnacle is Vocabulary.com. Vocabulary.com is an online website that perfected the process of learning new words. When you start, Vocabulary.com asks you questions to find out the current capacity of your vocabulary. After analyzing your level, they will create mini-games for you to play, each time questioning you with ten different words. As you answer more questions, you gain progress on that word, and once you reach 100%, you mastered it.</p><p>My method to use Vocabulary.com was to meticulously go over every word I didn’t know and add it to my list. I set a goal to finish ten games a day (I now have over a million points). I would read the definition at least once and add it to my list for every unrecognized word I noticed. After each round, I would go over each word five times and say the definitions out loud to further enhance my memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmjjOyyHlQyR3cqqtK0M0g.png" /><figcaption>How the definitions are written</figcaption></figure><p>The explanations on Vocabulary.com are top-notch, every word is accompanied by hundreds of sentences in which it was used in. (A web scraper collects sentences from the news). You even get statistics about how many times you may encounter the word in written text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*-mHoWCq0eHGdRxVjBC-TuA.png" /></figure><p>Each word also has synonyms and antonyms to help you build a word-map. (A word map is an association between words in your mind that helps you recall similar words).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*bzsb54cYjzxVk8l-lo_klg.png" /></figure><p>There is a specialized list for you whether you are learning for the SAT or struggling with a new book. I mostly used the SAT lists, but now I use lists specific to books I am reading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qLt8CajaCLCWJk-zF9Z9EA.png" /></figure><p>Understanding that mastering a word takes time, so you are tested on each word on multiple sessions spanning multiple days. Why so long? Because they want to make sure that you know every commonly used definition of the word. Also, they give you a little time to forget in between, so that they can make sure that you are retaining the knowledge you learned.</p><h3>Repetition</h3><p>A general misconception is that you can learn hundreds of words in a short period. I strongly object to this idea. In my opinion, constant repetition spread out for a long period is the perfect way to retain as many words as possible. Letting yourself forget a word and then relearning it help you to remember the word. Cramping for 10 hours on 50 words won’t be effective. You will probably forget most of them in the following week.</p><p><em>“significant gains in receptive lexical knowledge can be observed after as little as one exposure whereas the development of productive lexical knowledge requires a minimum of three encounters and increases significantly after seven occurrences.”</em></p><p>Webb, Stuart. (2007). The Effects of Repetition on Vocabulary Knowledge. Applied Linguistics. 28. 10.1093/applin/aml048.</p><p>My suggestion is that if you know that you have to learn words for a specific event (SAT for example), then you should try to spread out your studies instead of cramping before the test. For example, 1 hour a day for 5 months instead of 5 hours a day for 1 month.</p><h3>Images</h3><p>The saying “<em>A picture is worth a thousand words</em>” is particularly true regarding many words. There are words that no amount of verbal explanation can describe, and thus I advocate for incorporating images in your studies.</p><p>Let’s take the word “awning,” for example. Here is the definition by Vocabulary.com:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*mrwVG_9-H5we0O2Uv8ANgg.png" /></figure><p>Now you probably have a good understanding of the word, but let’s further incorporate it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*DtldBu2rMY-Nh_jN" /></figure><p>The combination of the verbal meaning of a word and its image can solidify the idea. Triggering different parts of your brain is a great approach to learn anything, especially vocabulary.</p><p>My suggestion is to search for images of confusing words. Maybe even keep a document linking between words and their corresponding images.</p><h3>Conclusion</h3><p>The tools demonstrated above can help you have immense success in learning new words. I hope you will try them out and build your formula, creating a strategy that works for you. Best of luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbf606813dfd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/3-effective-ways-to-improve-your-vocabulary-bbf606813dfd">3 Effective Ways To Improve Your Vocabulary</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.js Explained]]></title>
            <link>https://medium.com/swlh/node-js-explained-dad7b23d027d?source=rss-6154f82ebb66------2</link>
            <guid isPermaLink="false">https://medium.com/p/dad7b23d027d</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Raz Gaon]]></dc:creator>
            <pubDate>Wed, 29 Apr 2020 17:46:11 GMT</pubDate>
            <atom:updated>2020-04-30T15:25:10.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AB_1XQeJ4AJ569qb.png" /></figure><h3>What is Node.js?</h3><p>A general misconception is that Node.js is a programming language. This article will explain the ins and outs of Node.js, helping you build a better foundation for potential future projects.</p><h4>The short version</h4><p>Node.js is a JavaScript runtime environment that enables developers to execute Javascript code outside the browser.</p><h4>The long version</h4><p>Prior to 2009, Javascript was almost exclusively used inside browsers. Each browser had a Javascript engine that executed the code. Developers had to write server-side applications with different programming languages such as Python, PHP, Java, etc. The issue during this period was that any developer who wanted to write Javascript code both on the client-side and on the server-side had to learn an additional programming language.</p><p>Disclaimer: Netscape (the company that created JS) developed a server-side Javascript environment called LiveWire Pro Web, but it didn’t gain traction and wasn’t widely used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/0*EdRYoKxkgIiWKIe4.png" /></figure><p>Then came Ryan Dahl…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/0*j_D7d6FzHr4uweME" /></figure><p>Dahl created Node.js because of the limited ability of popular HTTP servers like Apache to handle concurrent connections. He envisioned a server that can handle a magnitude of concurrent connections in a non-blocking way.</p><p>Under the hood, Dahl used Chrome’s V8 Javascript engine to empower Node.js.</p><h3><strong>Why use Node.js?</strong></h3><p>For the sixth year in a row, <a href="https://stackoverflow.com/jobs?sort=i&amp;q=javascript">JavaScript</a> is the most commonly used programming language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*87mAjumoLZFDTbkZW0HaPQ.png" /><figcaption>Stackoverflow annual developer survey</figcaption></figure><p>Node.js continues to be the most commonly used technology in this category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42_UT3VVEnVpyytSLL4SrA.png" /><figcaption>Stackoverflow annual developer survey</figcaption></figure><p>Node.js represents a “JavaScript everywhere” paradigm, unifying web application development around a single programming language, rather than different languages for server- and client-side scripts.</p><h3>A little bit of history</h3><p>JavaScript is a programming language that was created at Netscape as a scripting tool to manipulate web pages inside their browser, <a href="https://en.wikipedia.org/wiki/Netscape_Navigator">Netscape Navigator</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LQkMj1ltUB5z7qGN.png" /><figcaption>Netscape</figcaption></figure><p>What is a web browser? It is a container that enables you to run numerous applications without downloading them to your device. Every mobile phone user has at least 20 applications on his device. In reality, a browser can run all of these applications without the user downloading a single one.</p><p>One key factor that led to the rise of Node.js was the timing. Just a few years earlier, JavaScript had started to be considered as a more serious language, thanks to the creation of more advanced web applications. Coupled with the realization that web browsers should serve the user the same experience as a native application, fueled the rise of Node.js.</p><p>As a result, JavaScript engines became considerably better as many browsers competed to offer users the best performance. Major browsers gradually offered better support for JavaScript and improved the execution speed of Javascript in the browser. The leading Javascript engine, V8, lead the improvement of the Javascript engines.</p><h3>Node.js Ecosystem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XPrIwm7n_PzIQnRo.png" /></figure><p>Since the introduction of <a href="https://www.npmjs.com/">npm </a>(Node Package Manager), over a million libraries were built by the community. Node.js has an extremely rich ecosystem, with the most third-party libraries out of all other ecosystems.</p><p>Node.js has libraries that can handle almost any task, ranging from <a href="https://www.npmjs.com/package/tensorflow">Machine Learning</a> to <a href="https://www.npmjs.com/package/excel4node">parsing Excel files</a>. Once you get comfortable with npm and the ecosystem, you can find many jewels that will accelerate your development process.</p><h3>Node.js And The Browser</h3><p>Both the browser and Node.js use JavaScript as their programming language.</p><p>As a full-stack developer, using the same language for the front-end and the back-end is a huge relief and time-saver. No more syntax errors, different naming conventions, different libraries, etc.</p><p>It is difficult to fully, deeply learn a programming language, and by using the same language to perform all your work on the web — both on the client and on the server, Node.js enables you to maximize your knowledge.</p><p>A great combination, for example, is Nestjs and Angular. Nest’s architecture patters are mostly derived from the Angular project, thus developers who combine both frameworks use the same architecture both in the client and in the server.</p><p>So I mentioned that Node.js uses Chrome’s Javascript engine. What is the difference then between executing Javascript on Chrome and on Node.js?</p><p>In the browser, we have the window object available. In Node.js we have process . Why? In the browser, most of the time what you are doing is interacting with the DOM or other Web Platform APIs like Cookies. Those do not exist in Node.js, of course. In the browser, on the other hand, we do not have access to the host’s resources as we do in a Node execution environment (filesystem, memory, etc).</p><p>Another big difference is that in Node.js you control the environment. You mostly know which version of Node.js you will run the application on. Compared to the browser environment, where you don’t get the luxury to choose what browser your visitors will use, this is very convenient.</p><p>This means that you can write all the modern JavaScript versions that your Node.js version supports.</p><h3>Summary</h3><p>Node.js is an amazing tool for developers to use on the back-end. It enables developers to use the same programming language throughout the whole development process. Node.js has a very modern approach and is suitable for handling concurrency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dad7b23d027d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/node-js-explained-dad7b23d027d">Node.js Explained</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Five tips for an aspiring software developer]]></title>
            <link>https://medium.com/weekly-webtips/five-tips-for-an-aspiring-software-developer-45315f2495a7?source=rss-6154f82ebb66------2</link>
            <guid isPermaLink="false">https://medium.com/p/45315f2495a7</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[improvement]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Raz Gaon]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 18:57:44 GMT</pubDate>
            <atom:updated>2020-06-04T12:01:41.857Z</atom:updated>
            <content:encoded><![CDATA[<h3>Five Tips for an Aspiring Software Developer</h3><p>Ah! Software development. Such an amazing job :)</p><p>The journey of an aspiring software developer is full of hurdles and hardships. I started my journey 6 years ago, and here are five tips that I would share with my junior self.</p><h3><strong>Knowledge is gained by self-learning</strong></h3><p>Each person has a different way of learning new material. One likes videos, one likes books, and another likes courses. It is critical to understand that there will come a time when only you will be able to solve a problem and there will be no external help. To prepare for that occasion, you must challenge yourself and train on your problem-solving skills. Once you encounter a challenge, scavenge the internet for a solution, test yourself, and create a belief that you are capable of anything. After a few iterations of this process, your self-belief will skyrocket and you will be able to solve any challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8lWlmSRM5ximHik5gkwVA.jpeg" /></figure><h3><strong>Understand the game before jumping in</strong></h3><p>Many new developers don’t have a proper understanding of the path they want to take; they just jump into a programming language or framework and start learning. In my opinion, this is a grave mistake. Just like you don&#39;t take your car out without having a clear destination to drive to, you shouldn&#39;t dive into learning before you understand what it is you are learning. These are the steps I recommend taking before diving in:</p><ol><li>Choose what it is I want to do (game development, web development, embedded systems, financial analysis, machine learning, etc)</li><li>Get an overview of the different technologies used in the area.</li><li>Write a clear path on how to get the knowledge needed to achieve your goal. Find information from various websites, blogs, books, videos, etc.</li><li>Start your journey.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tp9TG3O8xJYXXh4wvvhOJg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@alvaroreyes?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alvaro Reyes</a> on <a href="https://unsplash.com/s/photos/plan?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>Improvement is made by active training, not passive observing.</strong></h3><p>One of the greatest mistakes an aspiring developer can make is to watch endless tutorials and consume a myriad of books. The real improvement occurs while implementing the knowledge you gained in projects. You need to write code, find issues, fix them, etc. Many developers, including myself, started by watching countless hours of videos without writing a single line of code.</p><p>What I recommend: watch a video/read a book and then practice the concepts immediately after (small exercises or a big project). In addition, maybe find an interesting project and then plan your studies to help you build this project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWwvW4iLIOQ9XRuKqOSyPA.jpeg" /></figure><h3><strong>The most satisfaction you will find is from solving a challenging problem</strong></h3><p>Challenges can be digested in numerous ways. Every developer knows the frustration that comes when hitting a brick wall on a difficult problem. This happens plenty of times at the beginning of a developer’s journey. This brick wall caused many aspiring developers’ motivation to crumble.</p><p>What I recommend: take a short break and have another attempt. If you are unable to solve the problem, analyze what is preventing you from finding the solution — maybe you lack knowledge of algorithms or specific programming languages. Maybe it’s because you didn&#39;t check if there is a library or tool that can solve the problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BERXP_TC249W3MrmhaqtQQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@phammi?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">MI PHAM</a> on <a href="https://unsplash.com/s/photos/strategy?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3><strong>Stick to a routine — It’s a long journey</strong></h3><p>When starting to program, it is essential to stick to a routine. The beginning is the most difficult part, and if you take a long pause, you may never return. The routine depends on the person — how busy he is, the pace he wants to improve at, etc. Let’s say Tom has a routine. He reads a book about the fundamentals of javascript 2 hours a day and he solves programming challenges for another 3 hours a day. If Tom would stop this routine for 5 days, there is a great chance he won’t return to his routine and will not be a programmer.</p><p>What I recommend: if you find yourself in a situation where you don’t have the necessary amount of time to stick to your routine, reduce the amount of time you invest, but still continue — even 5 minutes a day. This way your motivation won’t disappear completely and you will be able to continue your journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u7FP1B2e9WEmrXNix1xjsw.jpeg" /></figure><p>I have to say that I enjoy programming so much. I learn something new almost every day, and I have the privilege to have an impact on thousands of people with the products I work on. The job is not easy — you have to be eager to constantly learn new concepts — but it is extremely rewarding. I hope you will have success in your journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45315f2495a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/weekly-webtips/five-tips-for-an-aspiring-software-developer-45315f2495a7">Five tips for an aspiring software developer</a> was originally published in <a href="https://medium.com/weekly-webtips">Webtips</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>