<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pınar Suvaçoğlu</title>
    <description>The latest articles on DEV Community by Pınar Suvaçoğlu (@mihalidis).</description>
    <link>https://dev.to/mihalidis</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F580754%2F7a892231-6d06-44ad-8fb5-72ec6c52bcd1.png</url>
      <title>DEV Community: Pınar Suvaçoğlu</title>
      <link>https://dev.to/mihalidis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mihalidis"/>
    <language>en</language>
    <item>
      <title>Cracking JavaScript: My Notes from LeetCode’s 30-Day Challenge</title>
      <dc:creator>Pınar Suvaçoğlu</dc:creator>
      <pubDate>Thu, 03 Apr 2025 22:05:21 +0000</pubDate>
      <link>https://dev.to/mihalidis/cracking-javascript-my-notes-from-leetcodes-30-day-challenge-2opd</link>
      <guid>https://dev.to/mihalidis/cracking-javascript-my-notes-from-leetcodes-30-day-challenge-2opd</guid>
      <description>&lt;p&gt;I have compiled my notes while working on LeetCode's &lt;a href="https://leetcode.com/studyplan/30-days-of-javascript/" rel="noopener noreferrer"&gt;30 Days of JavaScript&lt;/a&gt; exercises. This study covers key aspects of JavaScript and explains concepts we frequently use but may not fully understand. I believe it will also be very useful for interview preparation.&lt;/p&gt;

&lt;p&gt;Resources I use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I refer to ChatGPT for examples and explanations&lt;/li&gt;
&lt;li&gt;I use &lt;a href="https://frontendmasters.com/courses/javascript-quiz/" rel="noopener noreferrer"&gt;Test Your JavaScript Knowledge&lt;/a&gt; by &lt;a href="https://frontendmasters.com/teachers/lydia-hallie/" rel="noopener noreferrer"&gt;Lydia Hallie&lt;/a&gt; on Frontend Masters&lt;/li&gt;
&lt;li&gt;I also follow &lt;a href="https://leetcode.com/studyplan/30-days-of-javascript/" rel="noopener noreferrer"&gt;30 Days of JavaScript&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Part1: Closures
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Closures are a fundamental concept in JavaScript that allow functions to retain access to their lexical scope even after the outer function has finished executing. This is possible because functions in JavaScript "capture" the variables they reference from their surrounding scope.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Closures occur when:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A function is defined inside another function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The inner function uses variables from the outer function’s scope.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The outer function returns the inner function, and the inner function is later executed elsewhere.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A closure is when a function remembers its own lexical scope even if it is called by another function’s lexical scope.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If a function uses a variable outside of its own scope, it still has access to that variable even when executed from a different scope.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function counter() {
  let count = 0;
  return function () {
    count++;
    console.log(count);
  };
}

const increment = counter();
increment(); // 1
increment(); // 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why Are Closures Useful?
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Data Encapsulation:&lt;/strong&gt; Closures allow private variables by keeping them accessible only within a function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintaining State in Callbacks and Event Handlers:&lt;/strong&gt; Used in &lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;event listeners&lt;/code&gt;, or &lt;code&gt;asynchronous operations&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoiding Global Variables:&lt;/strong&gt; Helps prevent polluting the global scope.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Part2: Basic Array Transformations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Question: What Is the Performance Difference Between the &lt;strong&gt;ForEach Method&lt;/strong&gt; and the &lt;strong&gt;For Loop&lt;/strong&gt;?
&lt;/h3&gt;

&lt;h4&gt;
  
  
  For Loop
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;for&lt;/code&gt; loop is faster and can be optimized, but it requires more manual work. Its readability is lower.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Since it involves less abstraction, it is easier for the JavaScript engine (e.g., V8) to optimize.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Direct access: In a &lt;code&gt;for&lt;/code&gt; loop, array elements are accessed directly using &lt;code&gt;arr[i]&lt;/code&gt; in each iteration. This is faster compared to calling an internal function like forEach.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Disadvantage: Lower abstraction means writing more code, which reduces readability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ForEach Method
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;forEach&lt;/code&gt; provides abstraction for looping over an array. While it makes the code cleaner and more understandable, it comes with a performance cost. This is because a callback function is invoked in each iteration.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Part3: Function Transformations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Functional Programming
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;1. Pure Functions:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Pure functions are functions that always produce the same output for the same input and have no side effects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Pure function example
function add(a, b) {
  return a + b;  // Always returns the same output for the same input
}
console.log(add(2, 3));  // Output: 5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;2. Immutability:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;In functional programming, data should be immutable. This means that once a data structure is created, it should not be changed; instead, a new data structure should be created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Immutability example
const arr = [1, 2, 3];
const newArr = [...arr, 4];  // Instead of modifying the original array, we create a new one
console.log(arr);     // Output: [1, 2, 3]
console.log(newArr);  // Output: [1, 2, 3, 4]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;3. High-Order Functions:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;High-order functions are functions that can take other functions as arguments or return a function (e.g., &lt;code&gt;map&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;, &lt;code&gt;reduce&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// High-order function example
const numbers = [1, 2, 3, 4];

const doubled = numbers.map(num =&amp;gt; num * 2);  // 'map' is a high-order function
console.log(doubled);  // Output: [2, 4, 6, 8]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;4. Function Composition:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Function composition is the process of combining multiple functions to create more complex functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Function composition example
const add5 = x =&amp;gt; x + 5;
const multiplyBy2 = x =&amp;gt; x * 2;

const composedFunction = x =&amp;gt; multiplyBy2(add5(x));  // Compose functions

console.log(composedFunction(3));  // Output: 16 (3 + 5 = 8, 8 * 2 = 16)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;5. First-Class Functions:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Functions are first-class citizens, meaning they can be assigned to variables, passed as arguments, and returned from other functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// First-class function example
const greet = name =&amp;gt; `Hello, ${name}!`;

const sayHello = greet;  // Assigning a function to a variable
console.log(sayHello("Alice"));  // Output: Hello, Alice!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;6. Declarative Programming:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Declarative programming focuses on what needs to be done, rather than how it is done. For example, using &lt;code&gt;reduce&lt;/code&gt; instead of a &lt;code&gt;for&lt;/code&gt; loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Declarative programming example using reduce
const numbers = [1, 2, 3, 4];

// Using reduce to sum the numbers (declarative)
const sum = numbers.reduce((acc, num) =&amp;gt; acc + num, 0);
console.log(sum);  // Output: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;7. Recursion:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Recursion is a technique where a function calls itself instead of using traditional loops.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Recursion example
function factorial(n) {
  if (n === 0) return 1;
  return n * factorial(n - 1);  // Recursive call
}

console.log(factorial(5));  // Output: 120 (5 * 4 * 3 * 2 * 1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Using Memoize to cache Javascript function results and speed up your code!
&lt;/h3&gt;

&lt;p&gt;Memoization improves performance by storing the results of expensive function calls in a &lt;code&gt;cache&lt;/code&gt;. When the function is called again with the same inputs, it retrieves the result from the &lt;code&gt;cache&lt;/code&gt; instead of recomputing it, making execution faster.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A common example of memoization is optimizing recursive Fibonacci calculations:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function memoize(fn) {
  const cache = {};  // Stores computed results
  return function (...args) {
    const key = JSON.stringify(args);
    if (cache[key]) {
      console.log("Fetching from cache:", key);
      return cache[key];
    }
    console.log("Computing result for:", key);
    const result = fn(...args);
    cache[key] = result;
    return result;
  };
}

// Expensive Fibonacci function
function fibonacci(n) {
  if (n &amp;lt;= 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}

// Memoized Fibonacci function
const memoizedFibonacci = memoize(fibonacci);

console.log(memoizedFibonacci(10)); // Computed
console.log(memoizedFibonacci(10)); // Retrieved from cache

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Final Summary:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The memoize function takes a function as an argument and returns a new function that &lt;code&gt;caches&lt;/code&gt; the results. When called with the same arguments, it retrieves the result from the &lt;code&gt;cache&lt;/code&gt; instead of recomputing it.&lt;br&gt;
This improves performance, especially for functions that take a long time to compute or are frequently called with the same arguments.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;How It Works:&lt;/strong&gt;&lt;br&gt;
The memoize function returns an inner function. This inner function takes a rest parameter &lt;code&gt;(...args)&lt;/code&gt;, allowing it to accept any number of arguments.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Part 4: Promises and Time In Javascript
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;Promise.all()&lt;/code&gt; Method
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;The Promise.all()&lt;/code&gt; method takes multiple promises as an array, executes them simultaneously, and waits for all of them to resolve successfully.&lt;/p&gt;

&lt;p&gt;If all promises succeed, it returns an array containing their results.&lt;/p&gt;

&lt;p&gt;If any promise rejects, even if others have already resolved, the first rejected promise is caught, and the execution moves to the &lt;code&gt;catch&lt;/code&gt; block.&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Interview Question on setTimeout &amp;amp; clearTimeout
&lt;/h3&gt;

&lt;p&gt;Question:&lt;br&gt;
What will be the output of the following code, and why?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log("Start");

setTimeout(() =&amp;gt; {
  console.log("Timeout");
}, 0);

console.log("End");

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer:&lt;br&gt;
The output will be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Start  
End  
Timeout  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;p&gt;JavaScript is single-threaded and uses an event loop.&lt;/p&gt;

&lt;p&gt;Even though the &lt;code&gt;timeout&lt;/code&gt; is set to 0 milliseconds, the callback is placed in the task queue and waits for the call stack to be empty.&lt;/p&gt;

&lt;p&gt;Since &lt;code&gt;console.log("End")&lt;/code&gt; is in the main execution thread, it runs before the timeout callback.&lt;/p&gt;

&lt;p&gt;This question will lead us to the Event Loop and Task Queue concepts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Event Loop and Task Queue
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Web APIs are managed by the &lt;strong&gt;Event Loop&lt;/strong&gt; and add tasks to the appropriate &lt;strong&gt;Task Queue&lt;/strong&gt; when the &lt;strong&gt;Call Stack&lt;/strong&gt; is empty.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Microtask Queue&lt;/strong&gt; executes before the &lt;strong&gt;Macro Task Queue&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;*&lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;setInterval&lt;/code&gt;, &lt;code&gt;DOM Events&lt;/code&gt;, and &lt;code&gt;WebSockets&lt;/code&gt; belong to the Macro Task Queue.&lt;/p&gt;

&lt;p&gt;*&lt;code&gt;fetch().then()&lt;/code&gt;, &lt;code&gt;Promise.then()&lt;/code&gt; belong to the Microtask Queue.&lt;/p&gt;

&lt;p&gt;*The Event Loop processes the Microtask Queue first, then the Macro Task Queue in each cycle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tricky situations :)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new Promise(() =&amp;gt; console.log(5));
Here are the steps that occur:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;When new Promise() is called, the following steps occur:&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A Promise is created, and the executor function inside the constructor is executed immediately.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;console.log(5)&lt;/code&gt; runs immediately in the Call Stack.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;This operation does not go to the Web API or Task Queue because a Promise’s executor function runs synchronously&lt;/u&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If &lt;code&gt;resolve()&lt;/code&gt; or &lt;code&gt;reject()&lt;/code&gt; is called inside the executor, these calls are asynchronous and are added to the Microtask Queue.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Summary: How to Determine if a Task is a &lt;u&gt;Microtask&lt;/u&gt; or a &lt;u&gt;Macrotask&lt;/u&gt;?&lt;br&gt;
&lt;u&gt;You can use the following logic to identify whether an operation is a Microtask or a Macrotask:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
Asynchronous operations managed by JavaScript itself (&lt;code&gt;Promises&lt;/code&gt;, &lt;code&gt;async operations&lt;/code&gt;, &lt;code&gt;queueMicrotask&lt;/code&gt;) → Added to the Microtask Queue.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Promise-based tasks are the highest-priority asynchronous operations.&lt;/p&gt;

&lt;p&gt;The Microtask Queue runs immediately after the Call Stack is cleared.&lt;/p&gt;

&lt;p&gt;2.&lt;br&gt;
Operations managed by browser APIs (&lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;setInterval&lt;/code&gt;, &lt;code&gt;DOM Events&lt;/code&gt;, &lt;code&gt;WebSockets&lt;/code&gt;) → Added to the Macrotask Queue.&lt;/p&gt;

&lt;p&gt;The Macrotask Queue is processed in the next Event Loop cycle.&lt;/p&gt;

&lt;p&gt;It runs after all Microtasks are completed.&lt;/p&gt;

&lt;p&gt;3.&lt;br&gt;
General Rule:&lt;/p&gt;

&lt;p&gt;Tasks that require an immediate response are placed in the Microtask Queue (&lt;code&gt;Promises&lt;/code&gt;, &lt;code&gt;queueMicrotask&lt;/code&gt;, &lt;code&gt;MutationObserver&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Larger or scheduled operations are placed in the Macrotask Queue (&lt;code&gt;setTimeout&lt;/code&gt;, &lt;code&gt;DOM events&lt;/code&gt;, &lt;code&gt;WebSockets&lt;/code&gt;, &lt;code&gt;setInterval&lt;/code&gt;).&lt;/p&gt;
&lt;h3&gt;
  
  
  What is &lt;code&gt;Promise.race()&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Promise.race()&lt;/code&gt; is a JavaScript method that takes multiple &lt;code&gt;Promises&lt;/code&gt; and returns the first one that settles (either resolves or rejects). It "races" the Promises against each other and immediately returns the result of the first one that completes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const p1 = new Promise((resolve) =&amp;gt; setTimeout(resolve, 100, 'First'));
const p2 = new Promise((resolve) =&amp;gt; setTimeout(resolve, 50, 'Second'));

Promise.race([p1, p2])
  .then(result =&amp;gt; console.log(result)); // Output: 'Second'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What is Debounce?
&lt;/h3&gt;

&lt;p&gt;Debounce is a &lt;u&gt;programming technique&lt;/u&gt; used to limit the number of times a function is executed. It ensures that a function is only called once after a specified delay and prevents it from being called too frequently within that time frame.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Common Use Cases:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Preventing multiple API calls when a user types in a search box (e.g., live search)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reducing excessive button clicks (e.g., a "Submit" button)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimizing window resize or scroll event listeners&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  How Does Debounce Work?
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;When an event (like keypress, scroll, or resize) occurs, debounce waits for a defined time (delay) before executing the function.&lt;/li&gt;
&lt;li&gt;If the event happens again within that time, the timer resets.&lt;/li&gt;
&lt;li&gt;The function executes only after the delay has fully elapsed without further interruptions.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function debounce(func, delay) {
    let timeoutId;
    return function (...args) {
        clearTimeout(timeoutId); // Clear the previous timeout
        timeoutId = setTimeout(() =&amp;gt; func(...args), delay); // Set a new timeout
    };
}

// Example Usage
const searchInput = document.getElementById("search");

function fetchResults(query) {
    console.log(`Fetching results for: ${query}`);
}

const debouncedSearch = debounce(fetchResults, 500);

searchInput.addEventListener("input", (event) =&amp;gt; {
    debouncedSearch(event.target.value);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I know this isn’t an all-encompassing guide, but rather a collection of notes highlighting the key points I found important. Happy coding ^_^&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>leetcode</category>
      <category>interview</category>
    </item>
    <item>
      <title>Windows üzerinde geliştirme ortamı kurulumu</title>
      <dc:creator>Pınar Suvaçoğlu</dc:creator>
      <pubDate>Mon, 20 Feb 2023 20:27:24 +0000</pubDate>
      <link>https://dev.to/istanbulphp/windows-uzerinde-gelistirme-ortami-kurulumu-52fd</link>
      <guid>https://dev.to/istanbulphp/windows-uzerinde-gelistirme-ortami-kurulumu-52fd</guid>
      <description>&lt;h1&gt;
  
  
  Windows Üzerinde Geliştirme Ortamı Kurulumu
&lt;/h1&gt;

&lt;p&gt;Yeni yazılım öğrenmeye başlayan, ilk kurulumları nasıl yapacağını düşünenler için git, github'da proje oluşturma, ssh key ekleme, PHP için laragon kurulumu, composer kurulumu gibi konuları kısaca yazdım. &lt;/p&gt;

&lt;h1&gt;
  
  
  Windows üzerinde git kurulumu ve git bash ile unix command line kullanımı
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://gitforwindows.org/" rel="noopener noreferrer"&gt;https://gitforwindows.org/&lt;/a&gt; sayfasından git için gerekli kurulum dosyasını indiriyoruz ve çalıştırıyoruz. Herhangi bir değişiklik yapmadan ilerleyerek kurulum yapabilirsiniz. &lt;/li&gt;
&lt;li&gt;Terminal'de unix command line kullanımı için &lt;strong&gt;git bash&lt;/strong&gt; kullanılabileceği gibi, ben windows üzerinde terminal olarak "&lt;a href="https://hyper.is/" rel="noopener noreferrer"&gt;Hyper Terminal&lt;/a&gt;" tercih ediyorum. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hyper Terminal&lt;/strong&gt; kurulumu için, Git bash kurulumundan sonra &lt;a href="https://hyper.is" rel="noopener noreferrer"&gt;https://hyper.is&lt;/a&gt; 'den windows için kurulumu indirin, setup dosyasını çalıştırın. &lt;/li&gt;
&lt;li&gt;Kurulum tamamlandığında hyper'a girin ve sol üstten &lt;strong&gt;edit &amp;gt; preference&lt;/strong&gt; içerisine girin, içindekilerin hepsini silip &lt;a href="https://gist.github.com/coco-napky/404220405435b3d0373e37ec43e54a23" rel="noopener noreferrer"&gt;bu linkteki repository'den&lt;/a&gt; ayarları kopyalayıp yapıştırın ve kayıt edin. Hyper terminali kapatıp açın, artık unix komutlarını hyper terminalde kullanabilirsiniz. 🎉&lt;/li&gt;
&lt;li&gt;Hyper terminal , çokça teması olan, ekleyebileceğiniz bir sürü pluginler, bulunan, kendinize göre özelleştirebildiğiniz bir terminal.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Git ile local repository oluşturmak.
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Terminalde projenizin ana dizininde iken
&amp;gt; git init.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;komutunu çalıştırarak projenize git versiyon kontrol sistemini eklemiş oluyorsunuz.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git add .&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;komutu ile projenizin içerisindeki tüm dosyaları &lt;strong&gt;staging area&lt;/strong&gt;(Git klasörünüzde bulunan ve bir sonraki kayıt işlemine dahil olacak olan kodları tutan dosya). Eğer spesifik bir dosyayı eklemek istiyorsak ilgili dosyanın adını uzantısı ile birlikte yazarak ekleyebiliriz &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git add deneme.txt&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;staging area&lt;/strong&gt;'daki kaydedilen kodları bu komutun yazıldığı andaki hali ile kayıt etmek için aşağıdaki komutu çalıştırıyoruz ve yaptığımız değişiklikler local repository'mize kayıt edilmiş oluyor.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git commit -m "initial commit"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Github ile remote repository oluşturmak.
&lt;/h1&gt;

&lt;h2&gt;
  
  
  - &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;Github&lt;/a&gt; 'ın ana sayfasından eğer üyeliğimiz yok ise "signup" ile kayıt oluyoruz. Kayıt formunu doldurup hızlıca üye olabilirsiniz.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Github'a üye olduktan sonra, sağ üstte &lt;strong&gt;+&lt;/strong&gt; simgesine basarak &lt;strong&gt;"new repository"&lt;/strong&gt; ye giriyoruz.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv95c2rqimode0i5jwykj.jpg" alt="New Repository" width="350" height="262"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Açılan sayfadan, projemizin ismini ve açıklamalarını giriyoruz. Hali hazırda olan bir projenizi ekleyecekseniz zaten içerisinde mevcut &lt;strong&gt;readme&lt;/strong&gt; ve &lt;strong&gt;gitignore&lt;/strong&gt; dosyaları olacağı için burada oluşturmak zorunda değilsiniz. Projeniz ile birlikte de oluşturabilirsiniz.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4ynp1fkmcfuhcxqpjh7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4ynp1fkmcfuhcxqpjh7.jpg" alt="enter image description here" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Yukarıda oluşturduğumuz &lt;strong&gt;local repository&lt;/strong&gt;'i şimdi buradaki komutlar ile &lt;strong&gt;remote repository&lt;/strong&gt;'e göndereceğiz.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnufnuygbl6umiobozy0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbnufnuygbl6umiobozy0.jpg" alt="enter image description here" width="640" height="368"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Görselde ikinci kısımdaki
&amp;gt; git remote add origin &lt;a href="https://github.com/Katjulidis/my-laravel-project.git" rel="noopener noreferrer"&gt;https://github.com/Katjulidis/my-laravel-project.git&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;komut satırını çalıştırıyoruz. Böylece localde commitlediğimiz repository'i remote olarak stage'e eklemiş oluyoruz. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git branch -M main&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;burada main yerine başka bir isim de verebilirsiniz. Ancak genel olarak ana branch için "main" ya da "master" isimlendirilmeleri yapılır.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;git push -u origin main&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;komutu ile local repository, remote repository'e kopyalanmış olur.&lt;/p&gt;

&lt;h1&gt;
  
  
  Github hesabına ssh key eklenmesi
&lt;/h1&gt;

&lt;p&gt;SSH key, güvenli parola doğrulanmasını sağlamak için kullanılan anahtardır.*&lt;a href="https://www.cenuta.com/blog/ssh-key-nedir-ssh-key-anahtar-olusturma-islemi/" rel="noopener noreferrer"&gt;ssh key nedir?&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;İlk başta kurulumunu yaptığımız Hyper terminal ile git bash komutlarına ulaşabiliriz&lt;/li&gt;
&lt;li&gt;Anahtar oluşturmaya başlamak için, aşağıdaki koda kendi github hesabınıza ait mail adresini ekleyerek terminale yazıyoruz.
&amp;gt; ssh-keygen -t ed25519 -C "&lt;a href="mailto:your_email@example.com"&gt;your_email@example.com&lt;/a&gt;"&lt;/li&gt;
&lt;li&gt;"Enter a file in which to save the key" kısmını direk enter tuşuna basarak geçebilirsiniz, key'İ default olarak belirlediği directory'e kaydedicektir.&lt;/li&gt;
&lt;li&gt;"Enter passphrase" kısmında, SSH anahtarlarınızı her kullandığınızda parolanızı yeniden girmek zorunda kalmamak için bir kimlik doğrulama aracısı yapılandırabilirsiniz. (&lt;strong&gt;passphrase yazarken terminalde yazdığınız harfler/rakamlar gözükmeyecektir, phassphrase'inizi iki kere girmenizi isteyeceği için tek seferde yazıp enter ile ilerleyerek sorunsuz geçebilirsiniz bu kısmı&lt;/strong&gt;) &lt;a href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/working-with-ssh-key-passphrases" rel="noopener noreferrer"&gt;Daha detaylı bilgi için&lt;/a&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs66dc7gufxt1ruelot7h.jpg" alt="SSH Key oluşturma" width="640" height="308"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;işlem tamamlandığında yukarıdaki gibi bir ekranla karşılaşmanız gerekiyor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Github'da SSH key sekmesine aşağıdaki gibi ulaşabilirsiniz.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw7kco2i0f3hswhmb2mi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flw7kco2i0f3hswhmb2mi.jpg" alt="enter image description here" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;New SSH Key'e girdiğinizde aşağıdaki gibi bir ekran gelecek. En soldaki gibi .ssh klasörünün içerisindeki, sonu .pub ile biten dosyayı notepad ile açıp, içeriğini kopyalayın ve github'daki ilgili alana yapıştırıp "Add SSH key" ile keyinizi kayıt edin 🎉&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2qal9dz8a6a6q8tvtky3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2qal9dz8a6a6q8tvtky3.jpg" alt="enter image description here" width="640" height="320"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Laragon Kurulumu
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://laragon.org/download/" rel="noopener noreferrer"&gt;Laragon&lt;/a&gt; aynı xampp ve wamp gibi, localhost geliştirme ortamını sağlayan programdır. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;git, phpmyadmin, Node.js/MongoDB, Python/Django/Flask/Postgres, Ruby, Java, Go&lt;/strong&gt; için geliştirme ortamlarını destekler. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-Kurulum yaptıktan sonra sol alttaki &lt;strong&gt;start all&lt;/strong&gt; ile mevcut yüklü programları çalıştırır.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlxigr33wkfwcv7q2js2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlxigr33wkfwcv7q2js2.jpg" alt="enter image description here" width="640" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;İster laragon üzerinde her hangi bir yere sağ tıklayıp, ister windows simgelerinin olduğu yerden logosuna sağ tıklayarak,  &lt;strong&gt;Tool &amp;gt; Quick Add&lt;/strong&gt; ile kolayca istediğiniz ortamı ekleyebilirsiniz.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuq1jx7ifi3wclh7niygp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuq1jx7ifi3wclh7niygp.jpg" alt="enter image description here" width="640" height="510"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Geliştirme yapacağınız klasörleri &lt;strong&gt;Laragon &amp;gt; www&lt;/strong&gt; klasörünün içine eklemelisiniz. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Laragon'u &lt;strong&gt;start&lt;/strong&gt; ile başlattığınızdan emin olduktan sonra adres satırına &lt;strong&gt;localhost/proje-klasör-adı&lt;/strong&gt; yazdığınızda çalışıyor olacaktır. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Henüz bir proje eklemediyseniz, laragonun test için eklediği &lt;strong&gt;index.php&lt;/strong&gt; dosyası mevcut, adres satırına &lt;strong&gt;localhost&lt;/strong&gt; yazdığınızda çalışıyor olduğunu göreceksiniz.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ahez3xe0sv5uz3zw61u.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ahez3xe0sv5uz3zw61u.jpg" alt="enter image description here" width="640" height="334"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Composer Kurulumu
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;PHP'nin bağımlılık ve paket yöneticisi olan Composer kurulumu için &lt;a href="https://getcomposer.org/doc/00-intro.md#installation-windows" rel="noopener noreferrer"&gt;buradan&lt;/a&gt; &lt;strong&gt;&lt;a href="https://getcomposer.org/Composer-Setup.exe" rel="noopener noreferrer"&gt;Composer-Setup.exe&lt;/a&gt;.&lt;/strong&gt; 'yi indirip hızlıca kurulum yapabilirsiniz.&lt;/li&gt;
&lt;li&gt;Laragonun terminalini açıp &lt;strong&gt;composer --version&lt;/strong&gt; ile composer sürümünüzü kontrol edebilirsiniz.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Bağımlılıkları yüklemek için&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;composer require paket_adi&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paket kurulumu yapıldıktan sonra vendor klasörü içerisinde &lt;strong&gt;composer.json&lt;/strong&gt; isimli dosyada kurduğunuz paketleri görebilirsiniz.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Hali hazırda mevcut &lt;strong&gt;composer.json&lt;/strong&gt; dosyanız varsa, içerisindeki paketlerin kurulması için terminale aşağıdaki komutu girmeniz gerekiyor.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;composer install &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;mevcut paketleri güncellemek için&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;composer update&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Önemli Not&lt;/strong&gt;: Windows üzerinde composer indirilirken, kurulum yapıldıktan sonra terminale aşağıdaki komut girilerek, windowsta olmayan php paketleri görmezden gelmesini sağlayarak, çıkacak hataların önüne geçmiş olursunuz.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;composer install --ignore-platform-reqs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Npm Kurulumu
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.npmjs.com/" rel="noopener noreferrer"&gt;Npm&lt;/a&gt; uygulamanızda size kolaylık sağlayacak 3.parti yazılımları yüklemeyi ve bağımlılıkları yönetmeyi sağlayan paket yöneticisidir. &lt;/li&gt;
&lt;li&gt;Npm  &lt;code&gt;package.json&lt;/code&gt; dosyası ile projede kullanılan tüm paket ve bağımlılıkları barındırır. &lt;/li&gt;
&lt;li&gt;Npm kurulumu için Node.js kurulması gerekiyor, &lt;a href="https://nodejs.org/en/download/" rel="noopener noreferrer"&gt;node.js'in&lt;/a&gt; sitesinden indirme işlemini yaptığınızda npm'de onunla birlikte kurulmuş olacak. Yüklemeden sonra terminale &lt;code&gt;node -v&lt;/code&gt; yazdığınızda aşağıdaki gibi bir çıktı almanız gerekiyor. Tabii ki versiyonu yüklediğiniz güne göre değişiklik gösterebilir. Npm'i de aynı şekilde &lt;code&gt;npm -v&lt;/code&gt; ile yüklendiğini kontrol edebilirsiniz.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5slr07vxj3gx9ag448d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5slr07vxj3gx9ag448d.jpg" alt="Node Version" width="221" height="48"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;package.json&lt;/code&gt; dosyasını oluşturmak için projenizin ana dizininde &lt;code&gt;npm init&lt;/code&gt; komunu çalıştırmanız gerekiyor. Bu kısmı atlayıp daha sonra package.json üzerinden bu değişiklikleri yapmak istiyorsanız &lt;code&gt;npm init -y&lt;/code&gt; ile bu kısmı geçebilirsiniz.&lt;/li&gt;
&lt;li&gt;İçerisinde bağımlılıkları ve paketleri olan &lt;code&gt;package.json&lt;/code&gt; dosyası aşağıdaki gibi görünecektir&lt;/li&gt;
&lt;li&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiq5tom8mexhxsmi4r6wo.jpg" alt="enter image description here" width="640" height="614"&gt;&lt;/li&gt;
&lt;li&gt;Bu sayede projelerimizi github'a gönderirken &lt;code&gt;.gitignore&lt;/code&gt; 'a &lt;strong&gt;node_modules&lt;/strong&gt; klasörünü ekleriz ve büyük boyutlu bu paket dosyalarını göndermemiş oluruz. Projeyi bir başkası indirdiğinde ve ya bir başkasının projesini local'de çalıştırmak istediğinizde &lt;code&gt;npm init&lt;/code&gt; komutu ile tüm tanımlı bağımlılıkları yükleyebilirsiniz.&lt;/li&gt;
&lt;li&gt;Bir paket global olarak yüklenmek istendiğinde
&lt;code&gt;npm install &amp;lt;paket adı&amp;gt; -g --save-dev&lt;/code&gt; komutu kullanılır. 

&lt;ul&gt;
&lt;li&gt;Projeye özel olarak yüklenmekk istendiğinde sadece 
&lt;code&gt;npm install &amp;lt;paket adı&amp;gt; --save-dev&lt;/code&gt; yazılması yeterlidir&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
