Fading Coder

One Final Commit for the Last Sprint

NACOS Security Vulnerabilities and JavaScript Fundamentals

JavaScript Essentials JavaScript provides built-in modules through DOM and BOM APIs, while libraries like jQuery serve as external modules. Variable Declarations var counter; // Function-scoped variable let playerName = "Genshin"; // Block-scoped variable const GRAVITY = 9.8; // Immutable...

Introduction to Prototypes in JavaScript

Understanding Prototypes in JavaScript When we create a class using a constructor function, memory pre-allocates an object caled the prototype object. The constructor function has a prototype property pointing to this object, and the prototype object has a constructor property pointing back to the c...

Lessons Learned: Extracting Page Numbers from PDF.js

When working on a project that required retrieving the current page number from an embedded PDF viewer, I encountered several obstacles that took considerable time to resolve. This article documents the challenges I faced and the solutions I eventually implemented. Initial Setup The PDF viewer was h...

Understanding Destructuring Assignment Patterns in React Components

Nested Destructurnig in React When working with React comopnents, you'll frequently encounter destructuring assignment syntax throughout React codebases. This language feature was introduced in ES6 (ECMAScript 2015), but its usage is partciularly prevalent in React development. Interpreting Complex...

Radash Array Utilities: Core Methods and Implementation Breakdown

iterate: Sequential Value Transformation Usage Executes a transformation function repeatedly over a specified number of steps, carrying forward an accumulator value. Example import { iterate } from 'radash' const total = iterate( 5, (accumulator, step) => accumulator + step * 2, 0 ) // Result: 30...

Comparing Fetch API and Axios for HTTP Requests

Handling Cookies When making same-origin requests, both fetch and axios automatically include cookies. For cross-origin scenarios, however, different configurations are required: Fetch: You must explicitly set the credentials option to 'include' in the configuration object. Axios: You must set withC...

JavaScript Variable Declarations: let vs var Deep Dive

Block-Level Scoping with let Before ECMAScript 6, JavaScript lacked block-level scope. Variables declared with var inside blocks remained accessible outside them: { var score = 95; } console.log(score); // 95 The let keyword introduced true block scoping: { let score = 95; } console.log(score); // R...

Developing a University Innovation and Entrepreneurship Platform Competition Management Subsystem with Spring Boot, Vue.js, and Uni-app

This article details the development of a competition management subsystem for a university innovation and entrepreneurship platform. The project utilizes a robust technology stack, including Spring Boot for the backend, Vue.js for the frontend web interface, and Uni-app for cross-platform mobile ap...

XML-Based Data Exchange with AJAX

XML-Based Data Exchange Important: When the server responds with XML data, the content type must be set to: response.setContentType("text/xml;charset=UTF-8"); Both XML and JSON are common data ecxhange formats XML has larger file size and complex parsing. Less commonly used. JSON has smale...

Extending Built-in JavaScript Types in TypeScript

When subclassing native JavaScript constructors like Error or Array in TypeScript, unexpected behavior can occur if the code is compiled to ES5. Consider the following TypeScript implementation: class CustomFailure extends Error { constructor(errorMsg: string) { super(errorMsg); // Explicitly resto...