<?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 Rayiisp Pengchan on Medium]]></title>
        <description><![CDATA[Stories by Rayiisp Pengchan on Medium]]></description>
        <link>https://medium.com/@rayiisppengchan?source=rss-b2b46af0f8ae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Rayiisp Pengchan on Medium</title>
            <link>https://medium.com/@rayiisppengchan?source=rss-b2b46af0f8ae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:05:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rayiisppengchan/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[optString() VS getString() in JSON (JAVA)]]></title>
            <link>https://medium.com/@rayiisppengchan/optstring-vs-getstring-in-json-java-f63cca049979?source=rss-b2b46af0f8ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/f63cca049979</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[string]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Rayiisp Pengchan]]></dc:creator>
            <pubDate>Wed, 28 Feb 2024 03:55:26 GMT</pubDate>
            <atom:updated>2024-02-28T03:55:26.091Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s get to know how difference between optString() and getString() while you try to get a data from Json</p><h4><strong>optString() :</strong></h4><p>The optString method is annotated as <strong><em>“non-null”; </em></strong>It will return empty string &quot; &quot; if the key that you specify doesn’t exist.</p><p>By following these syntax below:</p><ul><li><strong>optString(String key) </strong>:- It returns the empty string &quot; &quot; if there is no such key</li><li><strong>optString(String key, String defaultValue) </strong>:- It returns the defaultValue if there is no such key.</li></ul><h4>getString<strong>() :</strong></h4><p>It will throws a JSONException if the key that you specify doesn’t exist.</p><p>By following the syntax below:</p><ul><li><strong>getString(String key)</strong></li></ul><p>Cheers, thanks for reading! 😊</p><p><a href="https://docs.oracle.com/middleware/maf240/mobile/api-ref/oracle/adfmf/json/JSONObject.html"><strong>Check more detail here</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f63cca049979" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Similarities and Differences of `||` and `??` — Javascript]]></title>
            <link>https://medium.com/@rayiisppengchan/the-similarities-and-differences-of-and-javascript-d3b2cf6ad278?source=rss-b2b46af0f8ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3b2cf6ad278</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nullish]]></category>
            <dc:creator><![CDATA[Rayiisp Pengchan]]></dc:creator>
            <pubDate>Sat, 20 Jan 2024 09:38:11 GMT</pubDate>
            <atom:updated>2024-01-20T09:38:11.764Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Similarities and Differences of `||` and `??` — Javascript</h3><p>In JavaScript, || (Logical OR) and ?? (Nullish coalescing operator) are operators used for handling nullish values or values not explicitly assigned (null or undefined). However, in practical use, they still have some subtle differences.</p><p><strong>|| (OR):</strong></p><p>In logic, we affectionately call this the ‘OR’ operator in JavaScript. It happily returns ‘True’ if either of the values is true. However, if both values are false, it gives back the last one. Besides returning a boolean, it’s also pretty cool because it can return other types of values too!</p><p>Tips 🎯: The expressions that can be converted to false are:</p><ul><li>null;</li><li>NaN;</li><li>0;</li><li>Empty string (&quot;&quot; or &#39;&#39; or ``);</li><li>undefined ;</li></ul><p>Just reading might be a bit confusing, right? Let’s check out some examples together for a better understanding!</p><blockquote><strong>Examples:</strong></blockquote><pre>const a = null;<br>const b = &quot;cat&quot;;<br>console.log(a || b); <br>// Expected output: cat<br><br>const c = &quot;dog&quot;;<br>const d = &quot;cat&quot;;<br>console.log(c || d); <br>// Expected output: dog<br><br>const e = 8;<br>const f = 3 + 4;<br><br>console.log(e &lt; f || e === f);<br>// Expected output: false<br><br>const g = false;<br>const h = &quot;&quot;;<br>console.log(g || h); <br>// Expected output: &quot;&quot;</pre><p><strong>?? (Nullish coalescing):</strong></p><p>The workings are similar to || but differ in that ?? focuses exclusively on null or undefined values. If the first value is a nullish one, it returns the second value without bothering about whether it’s true or false. 🚀✨</p><blockquote>Examples:</blockquote><pre>const a = null ?? &#39;string&#39;;<br>console.log(a);<br>// Expected output: &quot;string&quot;<br><br>const b = 0 ?? 42;<br>console.log(b);<br>// Expected output: 0<br><br>const c = undefined ?? &#39;&#39;;<br>console.log(a);<br>// Expected output: &quot;&quot;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3b2cf6ad278" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ความเหมือนที่แตกต่างของ || และ ?? — Javascript]]></title>
            <link>https://medium.com/@rayiisppengchan/%E0%B8%84%E0%B8%A7%E0%B8%B2%E0%B8%A1%E0%B9%80%E0%B8%AB%E0%B8%A1%E0%B8%B7%E0%B8%AD%E0%B8%99%E0%B8%97%E0%B8%B5%E0%B9%88%E0%B9%81%E0%B8%95%E0%B8%81%E0%B8%95%E0%B9%88%E0%B8%B2%E0%B8%87%E0%B8%82%E0%B8%AD%E0%B8%87-%E0%B9%81%E0%B8%A5%E0%B8%B0-javascript-67e21c91218a?source=rss-b2b46af0f8ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/67e21c91218a</guid>
            <dc:creator><![CDATA[Rayiisp Pengchan]]></dc:creator>
            <pubDate>Sat, 20 Jan 2024 08:40:14 GMT</pubDate>
            <atom:updated>2024-01-20T09:02:34.317Z</atom:updated>
            <content:encoded><![CDATA[<h3>ความเหมือนที่แตกต่างของ || และ ?? — Javascript</h3><p>Hi 👋</p><p>ในภาษา JavaScript || (Logical OR) และ ??(Nullish coalescing operator) คือตัวดำเนินการที่ใช้ในการจัดการค่า nullish หรือค่าที่ไม่ได้รับกำหนดค่า (null หรือ undefined) แต่จริงๆ แล้วในการใช้งานจริง มันยังมีความแตกต่างกันอีกเล็กน้อย</p><p><strong>|| (OR):</strong></p><p>ในทางตรรกศาสตร์เราจะเรียกตัวดำเนิกการนี้ว่า “OR” หรือ “หรือ” ซึ่งจะส่งคืนค่าจริง (True) เมื่อมีค่าใดค่าหนึ่งเป็นจริง แต่ถ้าทั้งสองค่าเป็นเท็จ (False) จะส่งคืนค่าสุดท้าย นอกจากจะส่งคืนค่าเป็น boolean แล้ว ก็ยังสามารถส่งคืนค่าในประเภทอื่นๆได้อีกด้วย</p><h3>Tips 🎯<strong>: ค่าเหล่านี้จะถูกเปลี่ยนเป็นเท็จ (False) เสมอ</strong></h3><ul><li>null;</li><li>NaN;</li><li>0;</li><li>สตริงเปล่า (&quot;&quot; or &#39;&#39; or ``);</li><li>undefined ;</li></ul><p>แค่อ่านอย่างเดียวอาจจะงงกันได้ใช่มั้ยคะ เราไปดูตัวอย่างการใช้งานกันดีกว่า 😎</p><blockquote><strong>ตัวอย่างการใช้</strong></blockquote><pre>const a = null;<br>const b = &quot;cat&quot;;<br>console.log(a || b); <br>// Expected output: cat<br><br>const c = &quot;dog&quot;;<br>const d = &quot;cat&quot;;<br>console.log(c || d); <br>// Expected output: dog<br><br>const e = 8;<br>const f = 3 + 4;<br><br>console.log(e &lt; f || e === f);<br>// Expected output: false<br><br>const g = false;<br>const h = &quot;&quot;;<br>console.log(g || h); <br>// Expected output: &quot;&quot;</pre><p><strong>?? (Nullish coalescing):</strong></p><p>ลักษณะการทำงานจะเหมือนกับ || แต่จะแตกต่างกันตรงที่ ?? จะสนใจเฉพาะค่า null หรือ undefined เท่านั้น ซึ่งหากค่าแรกเป็น nullish values จะส่งค่าคืนค่าที่ 2 เสมอโดยไม่สนใจว่าจะเป็นจริง (True) หรือเท็จ (False)</p><blockquote>ตัวอย่างการใช้งาน</blockquote><pre>const a = null ?? &#39;string&#39;;<br>console.log(a);<br>// Expected output: &quot;string&quot;<br><br>const b = 0 ?? 42;<br>console.log(b);<br>// Expected output: 0<br><br>const c = undefined ?? &#39;&#39;;<br>console.log(a);<br>// Expected output: &quot;&quot;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67e21c91218a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>