Posts

Showing posts from June, 2025

๐Ÿง  Contemplating a True Set

๐Ÿง  Equivalence in JavaScript: Contemplating a True Set In JavaScript,   equivalence   behaves differently depending on whether you're working with primitive or non-primitive types. For   primitives —such as numbers, booleans, strings, and symbols—equivalence is determined by comparing actual values. If two variables hold the same value, they are considered equivalent. However, for   objects and arrays , equivalence is   by reference . Two arrays   [0]   and   [0]   are not considered equal because they are separate instances, even though they contain identical content. ๐Ÿ”ฌ Snippet 1: Equivalence by Value and by Reference new Set ([ 0 , 0 ]); // => Set { 0 } new Set ([[ 0 ], [ 0 ]]); // => Set { [0], [0] } JavaScript’s   Set   treats the two   0   values as equivalent but considers   [0]   and   [0]   as distinct because they are different object instances. This reveals JavaScript’s mini...

๐Ÿงฑ v0.0.0-dev.1 — First Brick

๐Ÿงฑ v0.0.0-dev.1 — First Brick We’re excited to announce the   first prerelease   of   @fizzwiz/sorted :   v0.0.0-dev.1   — the   First Brick   in what aims to become a foundational library for   priority-aware collections   and   custom equivalence models . This release introduces the core building blocks: ๐Ÿ”ง Core Abstractions Collection   – a base interface for iterable containers Queue   – an extension for prioritizing and structuring exploration ๐Ÿ“ฆ Concrete Implementations ArrayQueue   – a simple queue based on insertion order SortedArray   – a comparator-based queue maintaining sorted state These implementations offer different   notions of equivalence   — by insertion order or by comparator — laying the groundwork for more powerful models based on   representation functions , coming soon. ๐Ÿงช This is a   prerelease , but it’s ready to explore. Your early feedback will help guide the evolution o...