Skip to main content
100%

This is so cool "Map function inside Map function"

✓ Published2🌍 Public
NNita
Last edited Feb 25, 2020
Created on Feb 25, 2020
Forked from React Starter

This example generates a field of 100 randomly scattered circles, each with a size and color derived from its position in a nested loop. The visualization uses React to render an SVG element, with the `map` function applied twice to iterate over an array of numbers, producing overlapping circles that appear scattered across the canvas. The code employs `Math.random` to introduce variability in each circle's x and y coordinates, while the `fill` attribute computes an RGB color value based on the current loop index. The example showcases nested array mapping within a React component to create generative art.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes