map(fn, [context])

Iterates over each element in the collection passing it to a callback function returning a new collection comprising of elements returned from the callback.

The callback is passed two arguments: the element and its index in the collection.

The context of the callback function is that of the collection unless specified otherwise as the context argument.

var col = Pablo();

col.push({cx:20,  cy: 20, r: 20, fill: 'red'}));
col.push({cx:60,  cy: 20, r: 20, fill: 'red'}));
col.push({cx:100, cy: 20, r: 20, fill: 'blue'}));
col.push({cx:140, cy: 20, r: 20, fill: 'red'}));

// Use map to filter out blue shapes
col = (elem, i) {
        if (Pablo(elem).attr('fill') === 'red') {
          return elem;

Painting is just another way of keeping a diary.
Pablo Picasso