<?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 rookie-dev on Medium]]></title>
        <description><![CDATA[Stories by rookie-dev on Medium]]></description>
        <link>https://medium.com/@perdanatech96?source=rss-decfb44cd76a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GZ2J2ET32Y-9P_Uinp7fCw.png</url>
            <title>Stories by rookie-dev on Medium</title>
            <link>https://medium.com/@perdanatech96?source=rss-decfb44cd76a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 03:08:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@perdanatech96/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[Understanding Hoisting in JavaScript]]></title>
            <link>https://medium.com/@perdanatech96/understanding-hoisting-in-javascript-112e674bf633?source=rss-decfb44cd76a------2</link>
            <guid isPermaLink="false">https://medium.com/p/112e674bf633</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[rookie-dev]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 09:48:10 GMT</pubDate>
            <atom:updated>2024-12-16T09:48:10.199Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ZbK22UOf_yFOqI1Ufr8jg.png" /></figure><h3><strong>What is Hoisting</strong></h3><p>Hoisting is a JavaScript behavior where variable, function, and class declarations are automatically moved to the top of their respective scopes. This process occurs during the compilation phase, which happens before the code is executed.</p><h3><strong>How Hoisting Works</strong></h3><p>The hoisting process occurs during the compilation phase, meaning it takes place before the code is executed. This process involves the following steps:</p><ol><li><strong>Scanning Declaration Code</strong>: During the compilation phase, before executing the code line by line, the JavaScript engine scans for declarations of variables, functions, and classes and allocates them in memory.</li><li><strong>Moving Declarations to the Top of Their Scope</strong>: Once the JavaScript engine identifies the declaration code, it moves these declarations to the top of their respective scopes.</li></ol><p>It’s important to note that this process only moves the declarations, not their initialization.</p><h3><strong>Hoisting Variable</strong></h3><p>In JavaScript, variables can be declared using var, let or const, and each has a unique hoisting behavior.</p><p><strong>Var Hoisting</strong></p><pre>console.log(animal); // undefined<br><br>var animal = &quot;cat&quot;;</pre><p>As shown in the code snippet above, we can access the animal variable before it is declared. However, the value retrieved is undefined, not the value assigned during initialization. This occurs because hoisting only moves the declaration, not the initialization.</p><p><strong>let and const hoisting</strong></p><p>Variables declared with let and const are also hoisted, just list var. However, unlike var, let and const cannot be accessed before their initialization. This restriction is due to the Temporal Dead Zone (TDZ), a period during which the variable cannot be accessed until it has been initialized.</p><pre>console.log(animal2); // ReferenceError: Cannot access &#39;hewan2&#39; before initialization<br>let animal2 = &quot;dog&quot;;<br><br>console.log(animal3); // ReferenceError: Cannot access &#39;hewan3&#39; before initialization<br>const animal3 = &quot;rabbit&quot;;</pre><h3><strong>Function Hoisting</strong></h3><p>In JavaScript, functions can be defined in two ways: through a function declaration or a function expression. These two approaches have some differences, one of which pertains to hoisting. Hoisting applies to function declarations but not to function expressions.</p><p>Below is a code snippet that illustrates the differences between function declarations and function expressions with respect hoisting:</p><pre>funcDecHoisting(); // “&quot;funcDecHoisting is called”<br><br>function funcDecHoisting() {<br> return &quot;funcDecHoisting is called&quot;<br>}<br><br>funcExHoisting(); // ReferenceError: funcExHoisting is not defined<br>const funcExHoisting = function() {<br> return &quot;funcExHoisting is called&quot;<br>}</pre><h3><strong>Hoisting class</strong></h3><p>Like variables and functions, classes are also affected by hoisting. However, due to the Temporal Dead Zone (TDZ), a class cannot be accessed before it is declared. This behavior is similar to how let and cost work.</p><p>Below is a code snippet demonstrating hoisting in class declarations:</p><pre>const catObj = new Cat();  // ReferenceError: Cannot access &#39;Cat&#39; before initialization<br><br>class Cat {<br> constructor() { <br>  this.sound = &quot;meow&quot;;<br>  }<br>}</pre><h3><strong>Conclusion</strong></h3><p>Now that we understand hoisting in JavaScript, let’s summarize it. Hoisting is a JavaScript behavior where variable, function, and class declarations are automatically moved to the top of their respective scope.</p><p>Here are the key differences in hoisting for variable, functions, and classes:</p><ul><li><strong>var variables</strong>: Can be accessed before their declarations, but their value will be undefined.</li><li><strong>let and const variables</strong>: Cannot be accessed before their declaration. Accessing them before declarations will result in a RefferenceError.</li><li><strong>Function declarations</strong>: Can be accessed before their declaration.</li><li><strong>Function Expression</strong>: Cannot be accessed before their initialization.</li><li><strong>Classes</strong>: Cannot be accessed before their declaration. Accessing them before declaration will result in a ReffereceError.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=112e674bf633" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Differences Between var, let, and const in JavaScript]]></title>
            <link>https://medium.com/@perdanatech96/differences-between-var-let-and-const-in-javascript-fb4422ed46e5?source=rss-decfb44cd76a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb4422ed46e5</guid>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[rookie-dev]]></dc:creator>
            <pubDate>Sun, 10 Nov 2024 06:21:31 GMT</pubDate>
            <atom:updated>2024-11-10T06:21:31.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GQmYfUUFFDZh9PR5zirlg.png" /></figure><p>Variable is one of most important thing in programming language. All application sources code out there consist variable.</p><p>Variable functioning to store the data or information in programming language so that when we want to use that data or information. We use variable and assign the data to it, we no need to call the data or information directly anymore. we only need to call the variable name, is it same as we call the data and information that has been assigned to it.</p><p>In variable declaration, each programming language has their own keyword and way. In JavaScript, there are 3 keywords to declare a variable. the keywords are var, let, and const.</p><p>What the differences between that three keywords? below I would explain the differences between that three.</p><h3>1. Accessibility</h3><p>Accessibility is closely related to scope where variable is able to accessed.</p><p><strong>var keyword<br></strong>var has global or functional scope. meaning, we can access all variable var from the inside function even though the variable is declared outside function. And we also are able to access the variable from the outside condition or looping statement even though the variable is declared inside the statement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*OEzmnY6FlzFlDnuAaJ_bFQ.png" /></figure><p><strong>const and let keywords<br>Both const and let keywords has smaller scope limit, those have scope accessibility. meaning, when we declare a variable with use these keywords, the variable is only able to accessed within the scope where it’s declared.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*dvQzS_XKPMXZpFrUkluJjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S4Y5U6kAyst3BL_zr-170g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HoHsiyLoaOTyaVynNMgT4Q.png" /></figure><p>when we run classDetail() function, it will cause RefferenceError because the we are accessing variable out of the scope it has.</p><h3>2. Hoisting</h3><p>Hoisting is an JavaScript behavior where variable, function, and class declaration are moved to the top of its scope where they are declared. With this behavior, we can access variables even though they have not been declared.<br>Keyword var has this feature, while let and const haven’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*R1vj3DHiuTNdhQHc_0P-_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZfeoeG9qHnBsaTgMQKhM2Q.png" /></figure><p>log <em>timeStudy is returning undifed, while const subject and romm are returning RefferenceError.</em></p><h3>3. The Nature of Its Value</h3><p>The last difference between these three keywords is the nature of its value. const has constant value. meaning, when a value has been assigned to variable const, it cannot be changed. while the value of var and let variable can be changed.</p><h3>Conclusion</h3><p>Either var, let, and const has own characteristic. Const is suitable to use for constant value which will never be changed. Let is suitable to use for variable which has possibility to change in the future and has small scope limit. Meanwhile, Var is suitable for global variable which is declared outside function and accessed in many functions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb4422ed46e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Apa itu React Native]]></title>
            <link>https://medium.com/@perdanatech96/pengenalan-mobile-app-dan-react-native-df11233e2be1?source=rss-decfb44cd76a------2</link>
            <guid isPermaLink="false">https://medium.com/p/df11233e2be1</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[hybrid-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[rookie-dev]]></dc:creator>
            <pubDate>Sun, 28 Apr 2024 08:32:28 GMT</pubDate>
            <atom:updated>2024-04-28T08:44:45.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZYPmpirmSefaqphunFB7rg.jpeg" /></figure><p>Akhir-akhir ini, perkembangan teknologi seluler sangat pesat. Setiap tahun, bulan, minggu, atau bahkan hari, berbagai merk dan varian ponsel terbaru terus bermunculan. Penggunaan smartphone juga semakin luas, hampir setiap orang memiliki smartphone. Bahkan, tidak jarang seseorang memiliki lebih dari satu smartphone.</p><p>Dengan perkembangan teknologi seluler yang cepat dan penyebaran yang luas, kebutuhan akan aplikasi seluler juga semakin tinggi. Yang dulunya ponsel hanya digunakan untuk telepon dan SMS, sekarang bisa digunakan untuk berbagai kegiatan, seperti berbelanja online, bersosial media, bermain game, mengedit foto dan video, serta keperluan-keperluan lainnya.</p><p>Untuk memenuhi kebutuhan akan aplikasi seluler, para pakar teknologi terus melakukan riset guna meningkatkan kecanggihan dan kecepatan aplikasi beserta cara membuatnya. Saat ini, terdapat beberapa jenis aplikasi seluler, salah duanya adalah aplikasi native dan hybrid.</p><h3>Aplikasi Native</h3><p>Aplikasi native adalah aplikasi yang diubuat untuk sistem operasi tertentu seperti iOS atau Android. Untuk membuat aplikasi native iOS, kita dapat menggunakan bahasa pemrograman seperti Objective C atau Swift, sedangkan untuk Android kita dapat menggunakan bahasa pemrograman seperti Java atau Kotlin. Aplikasi native dapat mengakses dan menjalankan fungsi dari perangkat seluler dengan mudah, memberikan pengalaman pengguna yang lebih baik, serta kecepatan aplikasi yang relatif lebih cepat.</p><p>Namun, jika kita ingin aplikasi yang dapat dijalankan di berbagai platform, maka kita harus membuat dua aplikasi yang berbeda dan menggunakan teknologi yang berbeda pula. Hal tersebut membutuhkan waktu, biaya dan sumber daya yang cukup besar.</p><h3>Aplikasi Hybrid</h3><p>Sederhananya, aplikasi hybrid adalah aplikasi yang dapat dijalankan di lintas platform seperti Android dan iOS. Aplikasi hybrid memiliki <em>source code </em>yang sama sehingga dapat menghemat biaya dan mempercepat waktu <em>development.</em></p><p>Terdapat beberapa teknologi yang saat ini banyak digunakan untuk membuat aplikasi hybrid, seperti React Native, Flutter, Kotlin Multiplatform Mobile (KMM), Ionic, Xamarin, dan lain sebagainya.</p><p>Aplikasi hybrid sangat cocok untuk pengembang yang memiliki waktu dan sumber daya terbatas namun ingin membuat aplikasi yang dapat dijalankan di berbagai platform. Dengan hanya menulis satu <em>source code</em> yang sama menggunakan teknologi yang sama, pengembang dapat menghasilkan aplikasi hybrid dan dapat dijalankan di platform iOS dan Android.</p><h3>Apa itu React Native</h3><p>React Native adalah sebuah kerangka kerja Javascript open source yang digunakan untuk mengembangkan aplikasi hybrid, dalam hal ini iOS dan Android. Dengan menggunakan React Native, kita dapat mengembangkan aplikasi untuk kedua platform tersebut tanpa perlu menulis dua <em>source code</em> yang berbeda.</p><p>React Native pertama kali diluncurkan oleh Facebook pada tahun 2015 dan telah mencapai versi 0.74 pada saat ini.</p><p>Saat ini, sudah banyak <em>developer</em> yang menggunakan React Native, total unduhan per minggunya mencapai lebih dari 2 juta per 25 April 2024. Banyak perusahaan, baik besar maupun kecil, yang menggunakan React Native.</p><p>Berikut adalah lima perusahaan besar yang menggunakan React Native:</p><ol><li>Meta</li><li>Microsoft</li><li>Amazon</li><li>Shopify</li><li>Wix</li></ol><h3>Alasan memilih React Native</h3><p>Selain karena konten ini membahas tentang React Native, berikut beberapa alasan kenapa saya memilih React Native dibandingkan dengan framework atau bahasa lain:</p><ol><li><strong>Aplikasi Hybrid Native</strong></li></ol><p>React Native mengkompilasi kode sumber JavaScript menjadi bahasa native yang digunakan di setiap sistem operasi atau platform. Untuk Android, React Native mengkompilasi kode sumber ke bahasa Java, sedangkan untuk iOS, React Native mengkompilasi kode sumber ke bahasa Swift. Hal ini sangat bermanfaat karena dengan mengkompilasi kode sumber ke bahasa native, aplikasi yang dibuat dengan React Native adalah aplikasi native dari kompilasi tersebut. Hal ini dapat berpengaruh pada pengalaman pengguna dan kinerja aplikasi dibandingkan dengan menggunakan hybrid webview.</p><p><strong>2. Menggunakan JavaScript atau TypeScript</strong></p><p>JavaScript atau TypeScript adalah salah satu bahasa pemrograman yang saat ini banyak digunakan, baik untuk platform web, backend, maupun mobile. Dengan popularitas JavaScript yang tinggi, tersedia banyak sumber belajar dan pustaka (library) yang memudahkan dalam memulai dan mengembangkan aplikasi menggunakan bahasa pemrograman JavaScript.</p><p>Sementara TypeScript, merupakan bahasa JavaScript yang memiliki fitur static type yang dikembangkan oleh perusahaan Microsoft. Fitur type dalam TypeScript sangat berguna untuk pengembangan aplikasi dengan cakupan yang besar dan melibatkan banyak pengembang. Dengan adanya fitur type, setiap pengembang dapat mengetahui tipe data dari variabel, parameter fungsi, hingga respons fungsi. Dengan demikian, pengembang tidak perlu lagi melakukan debug program tersebut terlebih dahulu, sehingga dapat menghemat waktu dan meminimalisir bug dalam proses pengembangan.</p><p><strong>3. Fitur Hot Reload</strong></p><p>Fitur ini sangat bermanfaat dalam proses pengembangan. Dengan fitur hot reload, pengembang dapat melihat perubahan secara real-time ketika ada perubahan yang disimpan dalam kode sumber. Ini dapat menghemat waktu pengembangan karena pengembang tidak perlu mem-build kembali aplikasi untuk melihat hasil perubahannya.</p><p><strong>4. Styling yang mirip dengan CSS</strong></p><p>Pengaturan gaya komponen dalam React Native sangat mirip dengan CSS, sehingga memudahkan bagi pengembang yang memiliki pengalaman menggunakan atau mempelajari CSS.</p><p><strong>5. Memiliki komunitas yang besar dan ekosistem pustaka yang luas</strong></p><p>React Native memiliki komunitas yang besar dan banyak pustaka yang tersedia bagi pengembang, yang dapat mempermudah proses pengembangan.</p><p><strong>6. Kode yang dapat digunakan kembali</strong></p><p>Dalam paradigma React, aplikasi terdiri dari sekumpulan “building block” yang dapat digunakan kembali dalam berbagai fitur. Hal ini dapat mempercepat proses pengembangan aplikasi.</p><h3>Kesimpulan</h3><p>Dengan perkembangan teknologi yang semakin pesat dan cepat, dibutuhkan pula teknologi yang dapat menyokong kecepatan perkembangan ini. React Native bisa menjadi salah satu solusi untuk mengatasi situasi tersebut, karena dengan menggunakan React Native, kita dapat mempercepat proses pengembangan sebuah aplikasi dengan biaya yang lebih murah.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df11233e2be1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>