Personal Notes, Practical Examples & JavaScript Reference
This repository contains my personal JavaScript notes and practical, example-driven code snippets collected while learning and working with JavaScript. Each file focuses on a single topic and contains short, runnable examples rather than long theoretical explanations.
- Reinforce JavaScript fundamentals through practice.
- Provide reusable, copy-paste-ready examples.
- Serve as a quick personal reference during development.
- Track my own learning journey with JavaScript.
- JavaScript beginners looking for practical examples.
- Frontend developers who want a quick reference.
- Developers refreshing JavaScript fundamentals.
Files are kept flat (no subfolders) since the repository is small enough that a single topic-per-file layout is faster to browse and link to than nested folders. The list below groups the files by topic in a recommended learning order — see Topics Covered.
The repository is organized by topic. Files are kept flat (no folders) for quick access, but they follow the logical learning order below.
- Definition.js —
const/let, nullish coalescing, logical operators - Condition.js — ternary,
isNaN, logical operators, double NOT - SwitchCase.js —
switchstatement - Loop.js —
for,for...in,for...of,while,do...while,forEach - TryCatch.js — error handling with
try/catch/finally - Fundamentals.js — scope, hoisting, closures,
this, prototype chain, equality, shallow vs deep copy, event loop,WeakMap/WeakSet
- Function.js — parameters, default/rest parameters, recursion,
call/apply/bind, IIFE - Arrow.js — arrow function syntax and usage
- Array.js — push/pop/shift/unshift/splice/slice, search, iteration, sorting, spread
- ArrayObject.js — working with arrays of objects: grouping, deduplication, mapping
- Object.js — object creation, destructuring, spread,
Objectstatic methods - Map.js —
Mapcollection - Set.js —
Setcollection, removing duplicates
- String.js — string methods (search, replace, split, case conversion, etc.)
- Math.js —
Mathmethods, rounding, random numbers - Date.js —
Dateobject, formatting, comparisons - Time.js —
setTimeout/clearTimeout - RegExp.js — regular expressions, common patterns
- Class.js —
class, constructors, getters/setters, static methods, inheritance - OOP.js — a small practical OOP example (product list)
- Promise.js —
Promise,async/await,Promise.all/allSettled/race - AJAX.js —
XMLHttpRequest(legacy) andfetch - Http.js — HTTP requests with native
fetch - Axios.js — HTTP requests with the Axios library (third-party)
These examples rely on browser-only globals such as
document,window, andnavigator. They are not meant to run directly in Node.js.
- DOM.js — selecting, creating, and manipulating DOM elements
- BOM.js —
window,location,history,navigator - Event.js — event listeners
- Storage.js —
localStorage,sessionStorage, cookies, IndexedDB - GoogleMap.js — Google Maps JavaScript API example (third-party API)
- Module.js — ES module
import/export, dynamicimport() - MetaProgramming.js —
Symbol, iterators, the iterable protocol
Not part of native JavaScript — included for reference since they are commonly used together with it.
- jQuery.js — jQuery selectors, DOM manipulation
- Basics (variables, conditions, loops, error handling, core JS concepts)
- Functions
- Data Structures (arrays, objects, Map, Set)
- Strings, Numbers & Dates
- OOP
- Async JavaScript
- Browser APIs
- Modules & Advanced JavaScript
- Third-Party Libraries
Open any topic file, read the short comments above each example, and try running or modifying the snippets locally to experiment.
- Files under Basics, Functions, Data Structures, Strings/Numbers/Dates, OOP, Modules & Advanced JavaScript are plain JavaScript and can be run directly with Node.js or in a browser console.
- Files under Browser APIs (
DOM.js,BOM.js,Event.js,Storage.js,GoogleMap.js) depend on browser globals (document,window,navigator) and are meant to run inside an HTML page, not Node.js. Axios.jsandjQuery.jsrequire their respective libraries to be loaded (vianpmor a<script>CDN tag).Http.js/AJAX.jsfetch examples call public demo APIs (e.g.jsonplaceholder.typicode.com) and require an internet connection.
The repository primarily uses modern JavaScript (ES6+): const / let, arrow functions, template literals, destructuring, spread/rest, optional chaining, nullish coalescing, and async / await. Some legacy patterns (var, XMLHttpRequest, prototype-style code) are intentionally kept for comparison and are noted as such in the code.
These examples are educational/reference material. Some snippets assume a specific runtime context (browser, Node.js, or a UI5/SAP application) and may need small adaptations depending on where you run them.
This is primarily a personal learning repository, but suggestions and corrections are welcome via issues or pull requests.
| Guide | Focus |
|---|---|
| ABAPGuide | ABAP language and techniques, classic to modern |
| CDSGuide | ABAP CDS, structured route through both generations |
| CDS-Cookbook | CDS and AMDP pattern library |
| GWGuide | SAP Gateway: SEGW and OData V2 |
| UIGuide | SAPUI5 and Fiori control and pattern reference |
| JSGuide (this repository) | Plain JavaScript and browser APIs |
| PYGuide | Python reference with verified outputs |
Serhat Mercan — SAP BTP & AI Technical Lead | Generative AI for SAP | ABAP & SAP Fiori/UI5
- LinkedIn: serhat-mercan
- E-mail: serhatmercan94@gmail.com
- GitHub: serhatmercan
See LICENSE.