<?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 yuni on Medium]]></title>
        <description><![CDATA[Stories by yuni on Medium]]></description>
        <link>https://medium.com/@gimyunhe?source=rss-a1b8ff6dd226------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mBFZAwyRr7n0V0blgAiaiA.jpeg</url>
            <title>Stories by yuni on Medium</title>
            <link>https://medium.com/@gimyunhe?source=rss-a1b8ff6dd226------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:32:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gimyunhe/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[Day 3: leetcode — JavaScript 30 Days challenge]]></title>
            <link>https://medium.com/@gimyunhe/day-3-leetcode-javascript-30-days-challenge-5c3d17490f27?source=rss-a1b8ff6dd226------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c3d17490f27</guid>
            <category><![CDATA[coding-test]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[leetcode-easy]]></category>
            <category><![CDATA[leetcode-js]]></category>
            <category><![CDATA[leetcode]]></category>
            <dc:creator><![CDATA[yuni]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 01:08:12 GMT</pubDate>
            <atom:updated>2025-11-13T01:08:12.914Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 3: leetcode — JavaScript 30 Days challenge</h3><p><a href="https://leetcode.com/problems/to-be-or-not-to-be/">2704. To Be Or Not To Be</a></p><p>Write a function expect that helps developers test their code. It should take in any value val and return an object with the following two functions.</p><ul><li>toBe(val) accepts another value and returns true if the two values === each other. If they are not equal, it should throw an error &quot;Not Equal&quot;.</li><li>notToBe(val) accepts another value and returns true if the two values !== each other. If they are equal, it should throw an error &quot;Equal&quot;.</li></ul><p><strong>Example 1:</strong></p><pre>Input: func = () =&gt; expect(5).toBe(5)<br>Output: {&quot;value&quot;: true}<br>Explanation: 5 === 5 so this expression returns true.</pre><p><strong>Example 2:</strong></p><pre>Input: func = () =&gt; expect(5).toBe(null)<br>Output: {&quot;error&quot;: &quot;Not Equal&quot;}<br>Explanation: 5 !== null so this expression throw the error &quot;Not Equal&quot;.</pre><p><strong>Example 3:</strong></p><pre>Input: func = () =&gt; expect(5).notToBe(null)<br>Output: {&quot;value&quot;: true}<br>Explanation: 5 !== null so this expression returns true.</pre><p><strong>Solution:</strong></p><pre><br>var expect = function(val) {<br>    return{<br>        toBe: function(n){<br>            if(val===n)<br>                return true;<br>            else<br>                throw new Error(&quot;Not Equal&quot;);<br><br>        },<br>        notToBe: function(n){<br>            if(val!==n)<br>                return true;<br>            else<br>                throw new Error(&quot;Equal&quot;)<br><br>        }<br>    }<br>};<br><br>/**<br> * expect(5).toBe(5); // true<br> * expect(5).notToBe(5); // throws &quot;Equal&quot;<br> */</pre><p>The part</p><pre>return {<br>    toBe: ...,<br>    notToBe: ...<br>}</pre><p>is returning an <strong>object literal</strong> — <br> that means expect() returns an object that contains two methods:<br> toBe and notToBe.</p><pre>{<br>    toBe: function(n) { ... },<br>    notToBe: function(n) { ... }<br>}</pre><ul><li>Then <strong>you choose which one to call</strong> based on what you write next.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c3d17490f27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 2: leetcode — JavaScript 30 Days challenge]]></title>
            <link>https://medium.com/@gimyunhe/day-2-leetcode-javascript-30-days-challenge-46ff21b8b307?source=rss-a1b8ff6dd226------2</link>
            <guid isPermaLink="false">https://medium.com/p/46ff21b8b307</guid>
            <category><![CDATA[leetcode-js]]></category>
            <category><![CDATA[practice-js]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[leetcode-easy]]></category>
            <category><![CDATA[coding-test]]></category>
            <dc:creator><![CDATA[yuni]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 00:25:32 GMT</pubDate>
            <atom:updated>2025-11-11T00:31:57.069Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 2: leetcode — JavaScript 30 Days challenge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2pFgVVa9V8MvCrJp.png" /></figure><h3>2620. Counter</h3><p>Given an integer n, return a counter function. This counter function initially returns n and then returns 1 more than the previous value every subsequent time it is called (n, n + 1, n + 2, etc).</p><p><strong>Example 1:</strong></p><pre>Input: <br>n = 10 <br>[&quot;call&quot;,&quot;call&quot;,&quot;call&quot;]<br>Output: [10,11,12]<br>Explanation: <br>counter() = 10 // The first time counter() is called, it returns n.<br>counter() = 11 // Returns 1 more than the previous time.<br>counter() = 12 // Returns 1 more than the previous time.</pre><p><strong>Example 2:</strong></p><pre>Input: <br>n = -2<br>[&quot;call&quot;,&quot;call&quot;,&quot;call&quot;,&quot;call&quot;,&quot;call&quot;]<br>Output: [-2,-1,0,1,2]<br>Explanation: counter() initially returns -2. Then increases after each sebsequent call.</pre><p><strong>Constraints:</strong></p><ul><li>-1000 &lt;= n &lt;= 1000</li><li>0 &lt;= calls.length &lt;= 1000</li><li>calls[i] === &quot;call&quot;</li></ul><p><strong>Solution:</strong></p><pre>var createCounter = function(n) {<br>  return function() {<br>    return n++;<br>  };<br>};</pre><p>Each time this counter function is called, it should return the current number and then increase it by 1</p><ol><li><strong>createCounter(n)</strong> is called with some starting value, for example 10.<br> It returns an <strong>inner function</strong> that still has access to n.</li><li>That inner function forms a <strong>closure</strong> — it “remembers” the variable n from its outer scope even after createCounter has finished running.</li><li>Every time the returned function (the counter) is called:</li></ol><ul><li>It returns the current value of n</li><li>Then increases n by 1 (n++)</li></ul><p>I was initially confused by the test input [&quot;call&quot;, &quot;call&quot;, &quot;call&quot;], but it’s just the style of their test system, which means they call the function three times. I think I need to get used to their test code style.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46ff21b8b307" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Basic 1]]></title>
            <link>https://medium.com/@gimyunhe/javascript-basic-1-880cc5ed7dae?source=rss-a1b8ff6dd226------2</link>
            <guid isPermaLink="false">https://medium.com/p/880cc5ed7dae</guid>
            <category><![CDATA[javascript-basics]]></category>
            <category><![CDATA[web-programming]]></category>
            <category><![CDATA[javascript-frameworks]]></category>
            <category><![CDATA[web-publishing]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[yuni]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 07:46:52 GMT</pubDate>
            <atom:updated>2025-11-10T07:46:52.467Z</atom:updated>
            <content:encoded><![CDATA[<p>For web programming</p><p>JavaScript is a language used to create dynamic web pages.</p><blockquote>Comparison: Java vs JavaScript</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*1JFQnkDZAsauxakD6FqEpw.png" /></figure><blockquote>Features</blockquote><ul><li><strong>Interpreted Language</strong> — executed line by line without prior compilation.</li><li><strong>Dynamic Typing</strong> — variable types are determined at runtime.</li><li><strong>Supports Structured Programming</strong>.</li><li><strong>Object-Based</strong> — JavaScript is an object-oriented language. Recently, it also supports the class keyword.</li><li><strong>Supports Functional Programming</strong> — functions are <em>first-class objects</em> in JavaScript, meaning functions themselves are treated as objects. Lambda expressions are also supported.</li></ul><blockquote>Embedding JavaScript in HTML</blockquote><p>Just like <strong>CSS</strong>, JavaScript can be inserted into an HTML document in <strong>three different ways</strong>:</p><ul><li><strong>Internal JavaScript</strong></li></ul><pre>&lt;!DOCTYPE HTML&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;title&gt;My First Javascript &lt;/title&gt;<br>    &lt;script&gt;<br>      document.write(&quot;Hello World!&quot;);<br>    &lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;&lt;/body&gt;<br>&lt;/html&gt;</pre><ul><li><strong>External JavaScript</strong></li></ul><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;script src=&quot;myscript.js&quot;&gt;&lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><pre>//myscript.js<br>document.write(&quot;Hello World!&quot;);</pre><ul><li><strong>Inline JavaScript</strong></li></ul><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;body&gt;<br>    &lt;button type=&quot;button&quot; onclick=&quot;alert(&#39;Hello World.&#39;)&quot;&gt;Press the button&lt;/button&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><blockquote>Variables(변수)</blockquote><ul><li>A <strong>variable</strong> is like a <strong>container that stores data</strong>.</li><li>There are <strong>three ways to declare a variable</strong> in JavaScript:</li></ul><ol><li><strong>Using </strong><strong>var</strong> – The var keyword was used in all JavaScript code.</li><li><strong>Using </strong><strong>let</strong> – Introduced in <strong>2015</strong>, the let keyword has several <strong>advantages over </strong><strong>var</strong> and is <strong>recommended for use</strong> in modern JavaScript.</li><li><strong>Using </strong><strong>const</strong> – The const keyword is used to <strong>declare constants</strong> (variables whose values do not change). It is <strong>recommended</strong> to use const for objects or values that should not be modified.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*inhmL8XsE0oZaxhiTvs5rg.png" /></figure><p>Example:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;body&gt;<br>    &lt;h1 id=&quot;test&quot;&gt;&lt;/h1&gt;<br>    &lt;script&gt;<br>      let x = 5;<br>      let y = 6;<br>      let z = x + y;<br>      document.getElementById(&quot;test&quot;).innerHTML = z;<br>    &lt;/script&gt;<br>    &lt;/body&gt;<br>&lt;/html&gt;</pre><blockquote>Template Literals</blockquote><ul><li>In JavaScript, when you want to <strong>insert variable values inside a string</strong>, it’s best to use the <strong>${ expression }</strong> format.</li><li>This type of string uses <strong>backticks (</strong><strong>...)</strong> instead of regular quotation marks and was introduced in <strong>JavaScript ES6</strong>.</li><li>Such strings are called <strong>template literals</strong>.</li></ul><pre>`Hello number.${x}` //put the vvalue of the variable x inside the string.</pre><blockquote>Object Type</blockquote><ul><li>An <strong>object</strong> is a way of <strong>grouping properties (attributes)</strong> and <strong>behaviors (methods)</strong> together to represent something.</li></ul><p>Example: A car has properties such as maker, model, color, and horsepower, and it also has behaviors such as start and stop.</p><pre>let myCar = { model: &quot;bmz&quot;, color: &quot;red&quot;, hp: 100 };<br><br>document.write(myCar.model + &quot;&lt;br&gt;&quot;);<br>document.write(myCar.color + &quot;&lt;br&gt;&quot;);<br>document.write(myCar.hp + &quot;&lt;br&gt;&quot;);</pre><blockquote>The +Operator in Strings</blockquote><pre>&lt;!DOCTYPE html&gt;<br>&lt;body&gt;<br>  &lt;script&gt;<br>    let x, y;<br>    x = 1 + 1 + &quot;Car&quot;;//The first is numeric addition and then string<br>    y = &quot;Car&quot; + 1 + 1;//The first operation involves a string so the numbers are converted to the strings<br>    document.write(x + &quot;&lt;br&gt;&quot;);<br>    document.write(y + &quot;&lt;br&gt;&quot;);<br>   &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><blockquote>The === and !== Operators</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quxVtvYYYUqZuBWG9gl3HA.png" /></figure><blockquote>Logical Operators</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQ1M4ChXWvhzvQya_NhnEg.png" /></figure><p>Example:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;body&gt;<br>  &lt;script&gt;<br>    let x = 3;<br>    let y = 4;<br>    document.write((x == 3 &amp;&amp; y == 7) + &quot;&lt;br&gt;&quot;);//false<br>    document.write((x == 3 || y == 4) + &quot;&lt;br&gt;&quot;);//true<br>  &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><blockquote>prompt() Function</blockquote><ul><li>The prompt() function displays a <strong>dialog window</strong> that allows the user to <strong>read a message and enter a response</strong>.</li><li>It <strong>returns the user’s input as a string</strong>.</li></ul><pre>&lt;script&gt;<br>  var age = prompt(&quot;put your age&quot;, &quot;putinternational age&quot;);<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*eieE2pd2aA50JjjEJYTmww.png" /></figure><blockquote>confirm() Function</blockquote><ul><li>The confirm() function displays a <strong>dialog window</strong> that informs the user of something and asks them to <strong>choose either “OK” or “Cancel.”</strong></li><li>It <strong>returns </strong><strong>true</strong> if the user clicks <strong>OK</strong>, and <strong>false</strong> if the user clicks <strong>Cancel</strong>.</li></ul><pre>&lt;script&gt;<br>  let user = confirm(&quot;confirm() delivers user&#39;s answer&quot;);<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*a5z2lPJ_Kp6kAW4c5JoqTQ.png" /></figure><blockquote>Accessing HTML Elements in JavaScript</blockquote><ul><li>In JavaScript, you can access an <strong>HTML element</strong> using the <strong>document.getElementById(id)</strong> method.</li><li>The <strong>id attribute</strong> in an HTML element is used to <strong>identify</strong> that specific element.</li></ul><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;body&gt;<br>    &lt;h1 id=&quot;test&quot;&gt;This is a heading.&lt;/h1&gt;<br>    &lt;script&gt;<br>        function func() {<br>            e = document.getElementById(&quot;test&quot;);<br>            e.style.color = &quot;red&quot;;<br>        }<br>    &lt;/script&gt;<br>    &lt;button type=&quot;button&quot; onclick=&quot;func()&quot;&gt;Click!&lt;/button&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*qisj46Fd-r7ocYZ1CC81UA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*8JLS7CYADnrv33KAuPGO0A.png" /></figure><blockquote>Anonymous Function</blockquote><ul><li>In JavaScript, a function can be created <strong>without giving it a name</strong>, often for <strong>one-time use</strong>.</li><li>Such a function is called an <strong>anonymous function</strong>.</li></ul><pre>&lt;script&gt;<br>    let greeting = function()<br>    {<br>        alert(&quot;Hello World&quot;);<br>    }<br>    greeting();<br>&lt;/script&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*eTC-lAZqMWjiXZ89ML9y9A.png" /></figure><blockquote>Arrow Function</blockquote><ul><li>It allows you to <strong>write functions in a shorter form</strong> compared to the traditional function keyword.</li><li>Arrow functions are especially useful when writing <strong>simple, one-line functions</strong> or <strong>callbacks</strong>.</li><li>They are <strong>similar to lambda expressions</strong> in Java and other modern languages.</li></ul><pre>// Traditional function<br>function add(a, b) {<br>  return a + b;<br>}<br><br>// Arrow function<br>const add = (a, b) =&gt; a + b;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=880cc5ed7dae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 1: leet code — JavaScript 30 Days challenge]]></title>
            <link>https://medium.com/@gimyunhe/day-1-leet-code-javascript-30-days-challenge-14b120aceb5d?source=rss-a1b8ff6dd226------2</link>
            <guid isPermaLink="false">https://medium.com/p/14b120aceb5d</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[js-tutorial]]></category>
            <category><![CDATA[js-arguments]]></category>
            <category><![CDATA[js-30days-challenge]]></category>
            <category><![CDATA[js]]></category>
            <dc:creator><![CDATA[yuni]]></dc:creator>
            <pubDate>Thu, 06 Nov 2025 00:17:35 GMT</pubDate>
            <atom:updated>2025-11-11T00:31:30.397Z</atom:updated>
            <content:encoded><![CDATA[<h3>Day 1: leetcode — JavaScript 30 Days challenge</h3><h3>2667. Create Hello Word Function</h3><p>Write a function createHelloWorld. It should return a new function that always returns &quot;Hello World&quot;.</p><p><strong>Example 1:</strong></p><pre>Input: args = []<br>Output: &quot;Hello World&quot;<br>Explanation:<br>const f = createHelloWorld();<br>f(); // &quot;Hello World&quot;</pre><pre>The function returned by createHelloWorld should always return &quot;Hello World&quot;.</pre><p><strong>Example 2:</strong></p><pre>Input: args = [{},null,42]<br>Output: &quot;Hello World&quot;<br>Explanation:<br>const f = createHelloWorld();<br>f({}, null, 42); // &quot;Hello World&quot;</pre><pre>Any arguments could be passed to the function but it should still always return &quot;Hello World&quot;.</pre><p><strong>Constraints:</strong></p><ul><li>0 &lt;= args.length &lt;= 10</li></ul><p><strong>Solution:</strong></p><pre><br>var createHelloWorld = function() {<br>    <br>    return function(...args) {<br>        return &quot;Hello World&quot;;<br>    }<br>};</pre><p>… args is called “<strong>rest parameter</strong>(나머지 매개변수)”</p><p>it collects all the arguments passed into a function and stores them in an <strong>array</strong> named args.</p><p>Example:</p><pre>function example(...args){<br>  console.log(args);<br>}<br><br>example(1,2,3)//logs [1,2,3]</pre><p>You can also use <strong>arguments</strong>, which automatically contains all the arguments passed to a function.<br> However, arguments is <strong>not a real array</strong>, so you <strong>can’t use array methods</strong> like map, forEach, or filter directly on it.<br> Also, arguments <strong>cannot be used in arrow functions</strong>.</p><pre>function example(arguments){<br>  console.log(arguments);<br>}<br><br>example(1,2,3)//logs [1,2,3]</pre><h3>💡<strong>In this problem</strong></h3><p>The …args part is actually <strong>meaningless — </strong>the function never uses any of the arguments. it will just return “Hello World” no matter what arguments are passed in.</p><p>well, I just worte the code on the template that’s why.🤣</p><p>you can just write:</p><pre>var createHelloWorld = function() {<br>    <br>    return function() {<br>        return &quot;Hello World&quot;;<br>    }<br>};</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14b120aceb5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What I learn at university as a computer science student.]]></title>
            <link>https://medium.com/@gimyunhe/what-i-learn-at-university-as-a-computer-science-student-66257860d3e5?source=rss-a1b8ff6dd226------2</link>
            <guid isPermaLink="false">https://medium.com/p/66257860d3e5</guid>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[yuni]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 10:59:20 GMT</pubDate>
            <atom:updated>2025-11-06T06:25:08.527Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, I’m a student who is majoring in computer science.</p><p>I want to use this blog to organize and review courses that I’m taking.</p><p>Also, I would be happy if anyone shares their thoughts and talks together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UliGCMna1lagfhPw" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=66257860d3e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>