clear(predicate)

Clears all cells that match a given condition, setting their values to null.

Example

(move the mouse to clear all 🐉 from the current column; click to reset)

edit, then run

Syntax

clear(predicate)

Parameters

Param Description
predicate Function: condition that determines which cells to clear. Receives { row, col, value } as input1
  1. The value field may be of any type, including functions or objects. ↩
What this page's examples use
p5.quadrille
drawQuadrille createQuadrille cellLength mouseCol clear
p5.js
createCanvas background

Names the analysis can prove are called, and the line each one is documented on. Local variables and members of an unknown receiver are left out.