Articles by Olorunfemi Akinlua
JavaScript Math.tan(): Tangent Examples in Radians and Degrees
JavaScript Math.tan(): tangent from radians, degrees conversion, and behavior near odd multiples of π/2.
JavaScript Math.log(): Natural Logarithm and Custom Base Examples
JavaScript Math.log(): natural log, log base 10, custom bases via change-of-base, and Infinity / NaN edge cases.
JavaScript Math.atan() and Math.atan2(): Arctangent Examples
JavaScript Math.atan() vs Math.atan2(): radians, degrees, quadrant-safe angles from (x, y), and when to prefer atan2 over y/x with atan.
JavaScript Math.asin(): Arcsine Examples in Radians and Degrees
JavaScript Math.asin(): arcsine in radians, domain -1 to 1, boundary values, NaN for invalid input, degrees conversion, and how it inverts Math.sin in range.
JavaScript Math.acos(): Arccosine Examples in Radians and Degrees
JavaScript Math.acos(): arccosine in radians, valid domain -1 to 1, NaN outside that range, degrees conversion, and a simple vector angle example.
JavaScript Math.hypot(): Hypotenuse and Distance Examples
JavaScript Math.hypot(): Euclidean length in 2D or many dimensions, overflow-safe hypotenuse, and distance-between-points patterns.
JavaScript Math.fround(): Single Precision Float Examples
JavaScript Math.fround(): 32-bit float rounding, why fround(0.1) can differ from 0.1, and when single-precision matters.
JavaScript Math.sqrt(): Calculate Square Root in JavaScript
JavaScript Math.sqrt(): principal square root, negative inputs yield NaN, decimals and zero, and distance formulas.
JavaScript Math.min(): Find the Minimum Number
JavaScript Math.min(): smallest of two or many values, spread with arrays, and how Infinity and NaN behave.
JavaScript Math.cos(): Cosine Examples in Radians and Degrees
JavaScript Math.cos(): cosine from radians, degrees conversion, periodic behavior, and common wave or circle use cases.
JavaScript Math.cbrt(): Calculate Cube Root in JavaScript
JavaScript Math.cbrt(): real cube roots for positive and negative numbers, how cbrt differs from ** (1/3), and when to prefer Math.cbrt.
JavaScript Math.random(): Random Numbers and Integers
JavaScript Math.random(): values in [0, 1), scaling to ranges and integers, why it is not crypto-grade, and when to use crypto.getRandomValues instead.
JavaScript Math.max(): Find the Maximum Number
JavaScript Math.max(): largest of two or many values, spread with arrays, and how -Infinity and NaN behave.
Remove Duplicates from Array in JavaScript
Learn how to remove duplicates from an array in JavaScript with Set, filter(), reduce(), and object key examples.
Convert JavaScript Dates to ISO Date String
Learn how to convert JavaScript dates to ISO date strings with toISOString(), template literals, and timezone-aware formatting examples.
Throw Errors in JavaScript the Right Way
Learn how to throw errors in JavaScript with Error, try-catch-finally, custom exceptions, and practical error handling examples.
JavaScript Validate Email Address with Regex
Learn JavaScript email validation with regex, HTML input type=email, and practical checks for valid and invalid email addresses.
Compare Dates in JavaScript with Examples
Learn how to compare dates in JavaScript with comparison operators, getTime(), and valueOf(), plus how to avoid timezone mistakes.
JavaScript URL Encode with encodeURI and encodeURIComponent
Learn JavaScript URL encoding with encodeURI() and encodeURIComponent(), including full URL encoding, query parameter encoding, and template literal examples.
JavaScript try catch: Handle Errors and Exceptions
Learn JavaScript try catch with syntax, thrown errors, finally blocks, return vs throw behavior, and practical error-handling examples.
Promise Chaining in JavaScript with then() and catch()
Learn promise chaining in JavaScript with then(), catch(), async/await, and Promise.all() examples that show how async steps flow together.
JavaScript Template Literals with Backticks and Expressions
Learn JavaScript template literals with embedded expressions, multiline strings, escaping backticks, tagged templates, and practical examples.
Create SVG with JavaScript
Learn how to create SVG with JavaScript using createElementNS, innerHTML, and safe SVG string examples.
Search JSON Objects Recursively in JavaScript
Learn how to search JSON objects recursively in JavaScript with value lookup, nested traversal, and practical examples.
JavaScript Typed Arrays Explained
Learn JavaScript typed arrays with Uint8Array examples, fill() and slice() usage, numeric buffers, and how typed arrays differ from regular arrays.
JavaScript Subclass with extends and super()
Learn JavaScript subclassing with class extends, super(), method overriding, instanceof checks, and prototype-based inheritance examples.
Spread Operator in JavaScript with Examples
Learn how the JavaScript spread operator works in function calls, arrays, and objects with practical examples.
Add Arrays in JavaScript with concat() and Set
Learn how to add arrays in JavaScript with concat(), spread syntax, and Set, including how to combine arrays and remove duplicates.
Sort an Array in JavaScript with sort()
Learn how to sort an array in JavaScript with sort(), compare functions, numeric ordering, and object sorting examples.
Convert Degrees to Radians in JavaScript
Learn how to convert degrees to radians in JavaScript with a custom helper function, Math.PI, and positive or negative angles.
