<?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 Tovi Newman on Medium]]></title>
        <description><![CDATA[Stories by Tovi Newman on Medium]]></description>
        <link>https://medium.com/@deartovi?source=rss-4460caee048d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XR6FvAQsZlZQG0skOdlPfA.jpeg</url>
            <title>Stories by Tovi Newman on Medium</title>
            <link>https://medium.com/@deartovi?source=rss-4460caee048d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 17:10:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deartovi/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[Javascript: let’s meet the event object]]></title>
            <link>https://medium.com/launch-school/javascript-lets-talk-about-events-572ecce968d0?source=rss-4460caee048d------2</link>
            <guid isPermaLink="false">https://medium.com/p/572ecce968d0</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[freecodecamp]]></category>
            <category><![CDATA[infotainment]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tovi Newman]]></dc:creator>
            <pubDate>Tue, 25 Jul 2017 19:27:46 GMT</pubDate>
            <atom:updated>2017-11-04T22:36:52.202Z</atom:updated>
            <content:encoded><![CDATA[<p>Whenever you interact with your browser, your browser creates an event object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*UhXz91Ou8cFgSf56AQLhYg.png" /></figure><p>This event object has properties that describe that interaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*pMwg-j49ornblIiccqX3JA.png" /></figure><p>In order to convert any given event into productive work, we need to create an “event handler” and register it with an element object from the DOM. For example: someElement.addEventHandler(&#39;click&#39;, someFunction);</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9YvaWDJ5tbmw1dOIHgcbuA.png" /></figure><p>Now, when our event object encounters an element with an event handler that meets certain criteria (we will talk about this in a bit), the handler will be triggered, and the function that it contains will execute. But how do events encounter event handlers?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*thQrK8UfVbNUn49uJh3TRA.png" /></figure><p>The short answer is that the event object must find and “fire” on <strong>all</strong> of the elements that could potentially have listeners registered to them for that event. Let’s learn how the browser achieves this.</p><p>One important property of an event object is “target”. The event target is the inner most nested element that was targeted by the event (e.g., the element that was clicked). The event object is about to go on a journey and the event target is its destination.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*HDZCmjEJuUbKQnI1zFswxA.png" /><figcaption>To access the target element property use event.target</figcaption></figure><p>In most cases, the “event path” starts at Window. From there, the event object “fires” on each ancestor element of the target as it moves toward the target. This is called the “capture phase”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*nCxqjgaVUHjqXya5RKAB6w.png" /><figcaption>Capture phase: dramatic reenactment</figcaption></figure><p>Once the event reaches the destination it finally gets to fire on the target element, just in case the target itself has an event handler registered to it. This is called the “target phase.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*ItgxSjfRwlJKkHhGbp6aTw.png" /></figure><p>Now, our event object must make the return trip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*95bkE1EC8rbHimTGBsM5ew.png" /></figure><p>The return trip back up to Window is called the “bubble phase.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*jPCpWGFK4QNQ-e9Jhag27Q.png" /><figcaption>No elements were harmed in the making of this sketch</figcaption></figure><p>Just remember, capture down, bubble up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*1gPTdAOWKimKgye1k49tcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*ovqw0HmV5UojD4rqp74l4Q.png" /><figcaption>Just remember, capture down, bubble up.</figcaption></figure><p>This round trip through all three phases is called the “event propagation path.”</p><p>Lets put the event propagation path aside for a moment and talk about what happens to an element when it is fired on by the event object. First off, the element that the event object is firing on at any given moment is called the “current target.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*qwRyFvYj-I3Pv-ItglUs2Q.png" /><figcaption>To access the current target property use event.currentTarget</figcaption></figure><p>Questions: How does the current target know whether or not to execute its function when an event object fires on it? Also, how do handlers avoid getting triggered twice, once for each (capture/bubble) phase?</p><p>Answer: If the currentTarget has an event handler attached to it that matches the event type <strong>and </strong>the handler is set to be triggered on the same phase that the event object is in, the handler will execute its function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*1EkPB9pVE0KMEM1Xdov4Jg.png" /><figcaption>Handler not triggered.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*0EUh3CVrg6gw260A-XWVQQ.png" /><figcaption>Handler triggered!</figcaption></figure><p>The reason there are three phases (capture, target, and bubble) is partially due to historical implementation and partially due to maximizing flexibility. In the past, different browsers chose to handle events in only one direction. Internet Explorer chose to only bubble, while most other browsers chose to only capture. These days, modern browsers default to handle most events on the bubble phase but allow developers the option of capturing instead. This flexibility allows developers greater control over when handlers are triggered.</p><p>To review, event propagation can be broken into three phases.</p><ol><li>The capture phase — event object starts at Window and moves towards event target firing on every element in its path.</li><li>The target phase —event fires only once on the target element.</li><li>The bubble phase — event fires on the parent of the target and keeps firing all the way back to Window.</li></ol><h3>Now that we’ve got some concepts down, let’s dive into some code!</h3><p>First let’s register an event handler with a very important event type. DOMContentLoaded This handler will trigger only after the DOM elements are loaded. <a href="https://codepen.io/handofthecode/pen/RZPZaw">Check it out!</a></p><p>But where is that event object? <a href="https://codepen.io/handofthecode/pen/eENGxp">Let’s pass him into the function!</a></p><p>There he is! Cute little fella. Let’s look at the event object’s propagation path by checking the <a href="https://codepen.io/handofthecode/pen/Kvpvbe">path property</a>.</p><p>There are just two elements here, that is because we started at window and our target is the document. <a href="https://codepen.io/handofthecode/pen/RZPZOo">Let’s check the target property to make sure.</a></p><p>It is common practice to nest all of your other listeners within this initial one. If you don’t, the nested elements that you register your other handlers to might not exist yet! This can be a little hard to demonstrate online because codepen and other sites make sure that the DOM is loaded before any scripts are read. But this wont always be the case in other environments such as your browser. Better to be safe than buggy.</p><p>Now that we’ve built our first event listener, let’s add some html with a div and attach a <a href="https://codepen.io/handofthecode/pen/rzVzmr">click handler to the document element.</a></p><p>Now let’s pass our event object to the function and see what the path and the target are. What do you think the target will be? <a href="https://codepen.io/handofthecode/pen/GvJMjM">Check it out.</a></p><p>So the target was the div element! That makes sense because even though we attached the click handler to the document, we targeted the div by clicking on it, and the div was nested within document. Try clicking outside the div.</p><p>So, what if we retrieve the currentTarget from the event object after clicking on div? <a href="https://codepen.io/handofthecode/pen/XabeRW">What do you think we will find?</a></p><p>The currentTarget of the event object is always going to be whatever element the event object is visiting at that moment in time. Since the alert code was triggered by the handler that the event object was visiting, the element connected to the handler at that moment is the currentTarget.</p><h3>Now let’s play with bubble, target, and capture.</h3><p>Let’s do a couple things:</p><ol><li>Let’s streamline our syntax a little by declaring our functions. Let’s make one that alerts ‘capture!’ and one that alerts ‘bubble!’.</li><li>Let’s add another click handler so we have one for each function. To set a handler to capture, pass true as a third parameter to the function. For consistency, pass false to the handler that we want to bubble.</li><li>Which handler do you think <a href="https://codepen.io/handofthecode/pen/MvwEvM">will trigger first?</a></li></ol><p>Now, just for fun, let’s register our handlers to the div instead. Oh no! Why did the <a href="https://codepen.io/handofthecode/pen/dzoVeR">bubble handler get triggered first?!</a></p><p>See if you can figure this one out on your own :)</p><p>That’s all for now. Thanks for reading!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*D-SYj17itJ4iaMT4GFXj8A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=572ecce968d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/launch-school/javascript-lets-talk-about-events-572ecce968d0">Javascript: let’s meet the event object</a> was originally published in <a href="https://medium.com/launch-school">Launch School</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I bombed my technical interview in 4 easy steps]]></title>
            <link>https://medium.com/launch-school/how-i-bombed-my-technical-interview-in-4-easy-steps-46e77356569a?source=rss-4460caee048d------2</link>
            <guid isPermaLink="false">https://medium.com/p/46e77356569a</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[how-to-study]]></category>
            <category><![CDATA[launch-school]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[assessment]]></category>
            <dc:creator><![CDATA[Tovi Newman]]></dc:creator>
            <pubDate>Sat, 12 Nov 2016 03:31:40 GMT</pubDate>
            <atom:updated>2017-11-04T23:51:55.192Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone, I am a student at Launch School. I recently crashed and burned in my 149 live coding assessment and I wanted to share my experience.</p><p>Here are the 4 things that I did that I believe led to my tragic result.</p><ol><li>I failed to prepare, AKA prepared to fail.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*1ajM-5GJDVgC2tM_R5pReA.jpeg" /></figure><p>I had spent the last couple days and the hours leading up to the assessment just coding instead of reviewing concepts. I should have been doing both, but I overestimated my ability to articulate the theory smoothly. I might have been able to squeak by, had my discomfort not snowballed, eventually paralyzing me to the point that I couldn’t even perform basic coding procedures that I do everyday without trouble. Ultimately, I’m glad I wasn’t able to squeak by because…</p><p>2. I understood the concepts, but not enough to explain them well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*TL-aImb0srhcC9pvsIf0sA.jpeg" /></figure><p>Understanding the concepts isn’t enough; you have to be ready to communicate them with the proper terminology and with confidence and ease. If you have to access your deep memory for half of the questions, you are going to feel the pressure and likely leave your happy place. If you are anything like me, when you leave your happy place, you also leave your ability to think creatively, and eventually, your ability to think at all.</p><p>3. I rushed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*29JJfSJcnwQexfv4eh2y7Q.jpeg" /></figure><p>One of the first concepts that I had to demonstrate was inheritance. This should have been effortless, which is why I should have taken my time. Instead, I frantically banged out the code so fast that I didn’t even use indentation. I didn’t even realize it until my interviewer, Chris told me that I had made his “eyes hurt.”</p><p>I never write code like this, even for drafts. What was happening? I was nervous and not being mindful, that’s what was happening.</p><p>4. I locked up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mvlIRcwFDf4lKR8oLfsFkQ.jpeg" /></figure><p>Stress begets more stress begets an avalanche of stress.</p><p>After several missteps, I was asked to demonstrate a concept that I have been using in my code all month long. I was doing it for fun the night before on a side project. But at this point, I actually felt scared to modify the code in front of me. As a survival instinct, my brain attached to a random and distant example that I could neither fully remember nor stop thinking about.</p><p>Systems-lockup, deer in the headlights, infinite loop.</p><p>It got so bad, I could just barely remember how to type “def initialize”. The final straw was just straight-up forgetting an edge-case of variable assignment that had been repeatedly drilled into us in the OOP curriculum and in the previous exam. I was done.</p><p>The aftermath:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*Eyjb37UZL1pJQdW0Cz5Rpg.jpeg" /></figure><p>After the assessment, Chris questioned my study habits. I know, it looks bad. It didn’t make any sense to me at first. I must be a horrible student. I had read all of the materials, coded all the examples by hand and played around with them. I passed the previous tests and I had even completed every single exercise and weekly challenge easy through advanced, before scheduling this assessment. Why didn’t my brain work??? What I realize now is that all of that experience coding couldn’t prepare me to explain those very concepts to another human being under pressure.</p><p>Conclusion:</p><p>If you haven’t done it before, failing an interview is crushing. And because it is so devastating, it is a great opportunity to learn about yourself. A couple of personal takeaways:</p><p>-I don’t do well under stress. My best bet of avoiding stress is to be hyper prepared. In order to prepare well I need to…</p><p>-Be wary of my self assessment. It’s intrinsically hard to hold yourself accountable in any online program. It’s easy to say, “I understand that pretty well” and get back to coding.</p><p>Thankfully, Launch School isn’t just preparing us to sit by ourselves in our rooms and code. We’re preparing for the real world. We are going to be interviewing for jobs and working on teams. We are going to need to have exceptional confidence both in our ability to communicate and in our understanding of how our tools work. I’m looking forward to this week of preparation, to make sure that I have both of those things in spades.</p><p>Thanks for reading and good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46e77356569a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/launch-school/how-i-bombed-my-technical-interview-in-4-easy-steps-46e77356569a">How I bombed my technical interview in 4 easy steps</a> was originally published in <a href="https://medium.com/launch-school">Launch School</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>