JavaScript Introduction to Wave Function Collapse Wave Function Collapse is an algorithm that generates structured randomness for applications like a randomized world or city map.