Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Category: JavaScript

JavaScript

JavaScript: Proxy Objects ile Reactive Programming

- 18.08.26 - ErcanOPAK comment on JavaScript: Proxy Objects ile Reactive Programming

๐ŸŽฏ Proxy Objects = Reactive Programming State changes need reactions. JavaScript Proxy Objects ile reactive programming yapฤฑn. ๐ŸŽฏ Proxy Implementation // 1. Basic Reactive Proxy function createReactiveObject(target, onChange) { return new Proxy(target, { set(obj, prop, value) { const oldValue = obj[prop]; obj[prop] = value; onChange(prop, value, oldValue); return true; }, get(obj, prop) { return obj[prop]; […]

Read More
JavaScript

JavaScript: Generators ile Stream Processing

- 18.08.26 - ErcanOPAK comment on JavaScript: Generators ile Stream Processing

๐Ÿ”„ Generators = Stream Processing Bรผyรผk veri setlerini iลŸlemek zor. JavaScript Generators ile veri akฤฑลŸlarฤฑnฤฑ verimli ลŸekilde iลŸleyin. ๐ŸŽฏ Generator ร–rnekleri // 1. Infinite Sequence function* fibonacci() { let a = 0, b = 1; while (true) { yield a; [a, b] = [b, a + b]; } } const fib = fibonacci(); fib.next().value; // […]

Read More
JavaScript

JavaScript: Functional Programming with Array Methods

- 17.08.26 - ErcanOPAK comment on JavaScript: Functional Programming with Array Methods

๐Ÿงช Functional Programming = Clean Code Imperative code is hard to maintain. Functional programming with array methods creates cleaner, more predictable code. ๐Ÿ“ Functional Patterns // Pure Functions const add = (a, b) => a + b; // Pure const getTotal = (cart) => cart.reduce(add, 0); // Pure // Higher-Order Functions const map = (fn, […]

Read More
JavaScript

JavaScript: Data Transformation with Array Methods

- 17.08.26 - ErcanOPAK comment on JavaScript: Data Transformation with Array Methods

๐Ÿ”„ Data Transformation = Clean Data Raw data needs processing. JavaScript array methods transform, filter, and aggregate data into usable formats. ๐Ÿ“ Data Processing Patterns // User Data const users = [ { id: 1, name: ‘Alice’, age: 25, city: ‘NYC’, active: true }, { id: 2, name: ‘Bob’, age: 30, city: ‘LA’, active: false […]

Read More
JavaScript

JavaScript: Build Offline Apps with localStorage

- 17.08.26 - ErcanOPAK comment on JavaScript: Build Offline Apps with localStorage

๐Ÿ’พ localStorage = Offline Data Persistence Users expect apps to work offline. localStorage provides client-side persistence for user preferences and app state. ๐Ÿ“ localStorage API // Set Data localStorage.setItem(‘key’, ‘value’); localStorage.setItem(‘user’, JSON.stringify({ name: ‘John’, age: 30 })); // Get Data const value = localStorage.getItem(‘key’); const user = JSON.parse(localStorage.getItem(‘user’)); // Remove Data localStorage.removeItem(‘key’); localStorage.clear(); // Remove […]

Read More
JavaScript

JavaScript: Building a Data Dashboard with Charts

- 16.08.26 - ErcanOPAK comment on JavaScript: Building a Data Dashboard with Charts

๐Ÿ“Š Data Dashboard = Visualization Data needs visualization. JavaScript charts create interactive data dashboards. ๐Ÿ“ Dashboard Implementation // Data Preparation const salesData = [ { month: ‘Jan’, sales: 12000 }, { month: ‘Feb’, sales: 15000 }, { month: ‘Mar’, sales: 18000 }, { month: ‘Apr’, sales: 14000 }, { month: ‘May’, sales: 22000 }, { […]

Read More
JavaScript

JavaScript: Working with JSON Data

- 16.08.26 - ErcanOPAK comment on JavaScript: Working with JSON Data

๐Ÿ“„ JSON = Data Exchange JSON is everywhere. JSON parsing and manipulation is essential for JavaScript developers. ๐Ÿ“ JSON Operations // Parse JSON const jsonString = ‘{“name”:”John”,”age”:30}’; const obj = JSON.parse(jsonString); // Stringify JSON const objData = { name: ‘John’, age: 30 }; const jsonData = JSON.stringify(objData); // Pretty Print console.log(JSON.stringify(objData, null, 2)); // Handle […]

Read More
JavaScript

JavaScript: Working with Dates and Times

- 16.08.26 - ErcanOPAK comment on JavaScript: Working with Dates and Times

๐Ÿ“… Date and Time = JavaScript Dates are tricky. JavaScript date handling helps you manage dates and times effectively. ๐Ÿ“ Date Operations // Create Date const now = new Date(); const specific = new Date(2024, 0, 15); // Jan 15, 2024 const fromString = new Date(‘2024-01-15T10:00:00’); // Format Date const date = new Date(); date.toLocaleDateString(); […]

Read More
JavaScript

JavaScript: Working with LocalStorage for Data Persistence

- 15.08.26 - ErcanOPAK comment on JavaScript: Working with LocalStorage for Data Persistence

๐Ÿ’พ localStorage = Data Persistence Data needs to persist. localStorage provides client-side data persistence for web applications. ๐Ÿ“ localStorage API // Basic Operations localStorage.setItem(‘key’, ‘value’); const value = localStorage.getItem(‘key’); localStorage.removeItem(‘key’); localStorage.clear(); // Storing Objects const user = { name: ‘John’, age: 30 }; localStorage.setItem(‘user’, JSON.stringify(user)); const stored = JSON.parse(localStorage.getItem(‘user’)); // Storing Arrays const items = […]

Read More
JavaScript

JavaScript: Building a Task Management App with Array Methods

- 15.08.26 - ErcanOPAK comment on JavaScript: Building a Task Management App with Array Methods

๐Ÿ“‹ Task Management = Array Methods Task management needs data manipulation. JavaScript array methods make it easy to manage tasks. ๐Ÿ“ Task Management class TaskManager { constructor() { this.tasks = []; this.id = 0; } // CRUD Operations addTask(title, priority = ‘medium’) { const task = { id: ++this.id, title, priority, completed: false, createdAt: new […]

Read More
JavaScript

JavaScript: Working with Promises and Async/Await

- 15.08.26 - ErcanOPAK comment on JavaScript: Working with Promises and Async/Await

โšก Promises = Async Made Easy Async code can be hard to manage. Promises and Async/Await make asynchronous code clean and manageable. ๐Ÿ“ Promise Patterns // Creating a Promise const fetchData = () => { return new Promise((resolve, reject) => { setTimeout(() => { try { const data = { id: 1, name: ‘John’ }; […]

Read More
JavaScript

JavaScript: Build Search Engine with Array Methods

- 02.08.26 - ErcanOPAK comment on JavaScript: Build Search Engine with Array Methods

๐Ÿ” Client-Side Search = Instant Results Users expect instant search results. JavaScript array methods enable fast client-side search with fuzzy matching and filtering. ๐Ÿ“ Search Engine Implementation class SearchEngine { constructor(data, options = {}) { this.data = data; this.options = { keys: options.keys || [‘title’, ‘description’], threshold: options.threshold || 0.3, maxResults: options.maxResults || 50, caseSensitive: […]

Read More
JavaScript

JavaScript: Build Real-time Data Dashboards with Array Methods

- 26.07.26 - ErcanOPAK comment on JavaScript: Build Real-time Data Dashboards with Array Methods

๐Ÿ“Š Real-time Dashboards = Data Visualization Modern dashboards process thousands of data points. JavaScript array methods efficiently transform, filter, and aggregate data for real-time visualization. ๐Ÿ“ Dashboard Data Processing // Real-time Sales Data const salesData = [ { timestamp: ‘2024-01-15T10:00:00Z’, product: ‘Laptop’, amount: 1200, region: ‘North America’ }, { timestamp: ‘2024-01-15T10:15:00Z’, product: ‘Mouse’, amount: 25, […]

Read More
JavaScript

JavaScript: Master Functional Array Methods for Clean Code

- 26.07.26 - ErcanOPAK comment on JavaScript: Master Functional Array Methods for Clean Code

๐Ÿงฉ Map, Filter, Reduce = Functional JavaScript Looping is imperative thinking. Functional methods transform data elegantly. Write cleaner, more declarative, and more testable code. ๐Ÿ” Array Transformation Patterns // Real-world E-commerce Example const orders = [ { id: 1, customer: ‘Alice’, total: 150, status: ‘completed’ }, { id: 2, customer: ‘Bob’, total: 75, status: ‘pending’ […]

Read More
JavaScript

JavaScript: Master Map, Filter, Reduce for Arrays

- 26.07.26 - ErcanOPAK comment on JavaScript: Master Map, Filter, Reduce for Arrays

๐Ÿ“Š Map, Filter, Reduce = Array Power Loops are imperative. Map, Filter, Reduce are functional. Transform, filter, accumulate โ€” elegant array manipulation. ๐Ÿ“ Map (Transform) // Map – Transform each element const numbers = [1, 2, 3, 4, 5]; // Double each number const doubled = numbers.map(n => n * 2); console.log(doubled); // [2, 4, […]

Read More
JavaScript

JavaScript: Master Event Delegation for Dynamic Content

- 25.07.26 - ErcanOPAK comment on JavaScript: Master Event Delegation for Dynamic Content

๐ŸŽฏ Event Delegation = Efficient Events Many event listeners are inefficient. Event delegation handles events for dynamic content with fewer listeners. ๐Ÿ“ Event Delegation Basics // Inefficient (multiple listeners) document.querySelectorAll(‘.item’).forEach(item => { item.addEventListener(‘click’, handleClick); }); // Efficient (single listener) document.getElementById(‘list’).addEventListener(‘click’, function(e) { const item = e.target.closest(‘.item’); if (item) { handleClick(e, item); } }); // Dynamic […]

Read More
JavaScript

JavaScript: Build Offline Apps with localStorage

- 25.07.26 - ErcanOPAK comment on JavaScript: Build Offline Apps with localStorage

๐Ÿ’พ localStorage = Offline Data Persistence Users expect apps to work offline. localStorage provides client-side persistence for user preferences and app state. ๐Ÿ“ localStorage API // Set Data localStorage.setItem(‘key’, ‘value’); localStorage.setItem(‘user’, JSON.stringify({ name: ‘John’, age: 30 })); // Get Data const value = localStorage.getItem(‘key’); const user = JSON.parse(localStorage.getItem(‘user’)); // Remove Data localStorage.removeItem(‘key’); localStorage.clear(); // Remove […]

Read More
JavaScript

JavaScript: Build Search Engine with Array Methods

- 25.07.26 - ErcanOPAK comment on JavaScript: Build Search Engine with Array Methods

๐Ÿ” Client-Side Search = Instant Results Users expect instant search results. JavaScript array methods enable fast client-side search with fuzzy matching and filtering. ๐Ÿ“ Search Engine Implementation class SearchEngine { constructor(data, options = {}) { this.data = data; this.options = { keys: options.keys || [‘title’, ‘description’], threshold: options.threshold || 0.3, maxResults: options.maxResults || 50, caseSensitive: […]

Read More
JavaScript

JavaScript: Build Real-time Data Dashboards with Array Methods

- 25.07.26 - ErcanOPAK comment on JavaScript: Build Real-time Data Dashboards with Array Methods

๐Ÿ“Š Real-time Dashboards = Data Visualization Modern dashboards process thousands of data points. JavaScript array methods efficiently transform, filter, and aggregate data for real-time visualization. ๐Ÿ“ Dashboard Data Processing Pipeline // Real-time Analytics Data Structure const salesData = [ { timestamp: ‘2024-01-15T10:00:00Z’, product: ‘Laptop’, amount: 1200, region: ‘North America’ }, { timestamp: ‘2024-01-15T10:15:00Z’, product: ‘Mouse’, […]

Read More
JavaScript

JavaScript: Master Map, Filter, Reduce for Arrays

- 25.07.26 - ErcanOPAK comment on JavaScript: Master Map, Filter, Reduce for Arrays

๐Ÿ“Š Map, Filter, Reduce = Array Power Loops are imperative. Map, Filter, Reduce are functional. Transform, filter, accumulate โ€” elegant array manipulation. ๐Ÿ“ Map (Transform) // Map – Transform each element const numbers = [1, 2, 3, 4, 5]; // Double each number const doubled = numbers.map(n => n * 2); console.log(doubled); // [2, 4, […]

Read More
JavaScript

JavaScript: Understand Hoisting

- 24.07.26 - ErcanOPAK comment on JavaScript: Understand Hoisting

๐Ÿ“ค Hoisting = Declaration Lifting Variables behave strangely. Hoisting explains it. Declarations lifted, assignments stay. ๐Ÿ“ Hoisting Examples // var hoisting console.log(x); // undefined (not error) var x = 5; // Equivalent to: var x; console.log(x); // undefined x = 5; // function hoisting sayHello(); // “Hello” function sayHello() { console.log(‘Hello’); } // function expression […]

Read More
JavaScript

JavaScript: Master the Spread Operator (…)

- 24.07.26 - ErcanOPAK comment on JavaScript: Master the Spread Operator (…)

… Spread Operator = Power Copying arrays is tedious. Spread operator makes it easy. Copy, merge, expand โ€” clean code. ๐Ÿ“ Spread with Arrays // Copy array const original = [1, 2, 3]; const copy = […original]; console.log(copy); // [1, 2, 3] // Merge arrays const arr1 = [1, 2, 3]; const arr2 = [4, […]

Read More
JavaScript

JavaScript: Use Strict Mode for Better Code

- 24.07.26 - ErcanOPAK comment on JavaScript: Use Strict Mode for Better Code

โšก Strict Mode = Better Code JavaScript is forgiving. Strict mode is strict. Catch errors early, write better code. ๐Ÿ“ Strict Mode Basics // Enable for entire script “use strict”; // Enable for function only function strictFunction() { “use strict”; // strict code } // Examples of strict mode // 1. Cannot use undeclared variables […]

Read More
JavaScript

JavaScript: Use Destructuring for Clean Assignment

- 24.07.26 - ErcanOPAK comment on JavaScript: Use Destructuring for Clean Assignment

๐Ÿ“ฆ Destructuring = Clean Assignment Extracting values is verbose. Destructuring makes it clean. Arrays, objects โ€” assign with ease. โŒ Verbose Extraction const user = { name: ‘Alice’, age: 30 }; const name = user.name; const age = user.age; โœ… Destructuring const user = { name: ‘Alice’, age: 30 }; const { name, age } […]

Read More
JavaScript

JavaScript: Master Map, Filter, Reduce for Arrays

- 24.07.26 - ErcanOPAK comment on JavaScript: Master Map, Filter, Reduce for Arrays

๐Ÿ“Š Map, Filter, Reduce = Array Power Loops are imperative. Map, Filter, Reduce are functional. Transform, filter, accumulate โ€” elegant array manipulation. ๐Ÿ“ Map (Transform) // Map – Transform each element const numbers = [1, 2, 3, 4, 5]; // Double each number const doubled = numbers.map(n => n * 2); console.log(doubled); // [2, 4, […]

Read More
JavaScript

JavaScript: Master the This Keyword

- 19.07.26 - ErcanOPAK comment on JavaScript: Master the This Keyword

๐ŸŽฏ Master the This Keyword this is confusing. Understanding this is essential. Context, binding, arrow functions โ€” master it. ๐Ÿ“ this in Different Contexts // Global context console.log(this); // Window (browser) // Function context function showThis() { console.log(this); // Window (strict: undefined) } // Object method const obj = { name: ‘Alice’, greet: function() { […]

Read More
JavaScript

JavaScript: Use Nullish Coalescing (??) for Defaults

- 19.07.26 - ErcanOPAK comment on JavaScript: Use Nullish Coalescing (??) for Defaults

?? Nullish Coalescing = Clean Defaults || has problems. Nullish coalescing (??) is better. Only null/undefined triggers default. โŒ Logical OR (||) const count = 0; const result = count || 10; // result = 10 (but should be 0!) โœ… Nullish Coalescing (??) const count = 0; const result = count ?? 10; // […]

Read More
JavaScript

JavaScript: Use Generators for Iterable Functions

- 19.07.26 - ErcanOPAK comment on JavaScript: Use Generators for Iterable Functions

๐Ÿ”„ Generators = Iterable Functions Normal functions run completely. Generators pause and resume. Infinite lists, async flows, custom iteration. ๐Ÿ“ Generator Basics // Generator function function* numberGenerator() { yield 1; yield 2; yield 3; } // Using generator const gen = numberGenerator(); console.log(gen.next()); // { value: 1, done: false } console.log(gen.next()); // { value: 2, […]

Read More
JavaScript

JavaScript: Use Rest Operator for Function Arguments

- 18.07.26 - ErcanOPAK comment on JavaScript: Use Rest Operator for Function Arguments

๐Ÿ“ฆ Rest Operator = Function Arguments Arguments object is clunky. Rest operator collects function arguments. Clean, flexible, powerful. โŒ Arguments Object function sum() { let total = 0; for (let i = 0; i < arguments.length; i++) { total += arguments[i]; } return total; } โœ… Rest Operator function sum(...numbers) { return numbers.reduce((a, b) => […]

Read More
JavaScript

JavaScript: Use IIFE for Module Pattern

- 18.07.26 - ErcanOPAK comment on JavaScript: Use IIFE for Module Pattern

๐Ÿ“ฆ IIFE = Module Pattern Global variables are bad. IIFE creates private scope. Module pattern, encapsulation, data privacy. ๐Ÿ“ IIFE Basics // Basic IIFE (function() { console.log(‘IIFE executed’); })(); // With parameters (function(name) { console.log(`Hello ${name}`); })(‘Alice’); // With return value const result = (function(a, b) { return a + b; })(5, 3); console.log(result); // […]

Read More
Page 4 of 11
ยซ Previous 1 2 3 4 5 6 7 8 9 … 11 Next ยป

Posts pagination

« Previous 1 2 3 4 5 6 … 11 Next »
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (661)
  • Add Constraint to SQL Table to ensure email contains @ (619)
  • Average of all values in a column that are not zero in SQL (577)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (553)
  • Find numbers with more than two decimal places in SQL (481)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • AฤŸ Hฤฑzฤฑ ฤฐzleyici Windows Uygulamasฤฑ v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store
  • WordPress: Fix a Navigation Block Losing Submenu Items After Sync
  • Visual Studio: Fix CodeLens Reference Counts Stuck at Stale Numbers
  • C#: Fix a UTF-8 String Literal Behaving Differently in a Switch
  • Photoshop: Fix a Liquify Mesh Snapping Back on a Smart Object
  • The AI Prompt That Turns a Crash Dump Into a Short Repro Script

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,068)
  • Get the User Name and Domain Name from an Email Address in SQL (990)
  • How to add default value for Entity Framework migrations for DateTime and Bool (986)
  • Get the First and Last Word from a String or Sentence in SQL (865)
  • How to select distinct rows in a datatable in C# (859)

Recent Posts

  • Network Speed Monitor Windows Application v2.5.1
  • AฤŸ Hฤฑzฤฑ ฤฐzleyici Windows Uygulamasฤฑ v2.5.1
  • How to make theater mode the default for Youtube
  • The AI Prompt That Audits a Function for Thread-Safety Gaps
  • Ajax: Fix a Fetch Request Caching a Response Despite No-Store

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com